@tempots/ui 2.10.0 → 3.1.0

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/README.md CHANGED
@@ -38,7 +38,7 @@ const focusedInput = html.input(
38
38
 
39
39
  // Create an element that detects when it's in the viewport
40
40
  const lazyLoadedContent = InViewport(
41
- { threshold: 0.5 }, // Options for intersection observer
41
+ {}, // Options for intersection observer
42
42
  (isVisible) => isVisible.value
43
43
  ? html.div('Content is visible!')
44
44
  : html.div('Loading...')
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var me=Object.defineProperty;var ge=(t,e,n)=>e in t?me(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ft=(t,e,n)=>ge(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tempots/dom"),R=require("@tempots/std"),Ut=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const n=e.split(".")||[];return n.length>1?"."+n.pop():void 0},Bt=(t,e)=>{const n=Ut(e);return n!=null&&(t.length===0||!t.some(o=>n==o))},ye=(t,e,n,o)=>{let s=t.target;for(;s!=null&&!(s instanceof HTMLAnchorElement);)s=s.parentElement;if(s==null)return!0;const i=s;if(t.button!==0||t.ctrlKey||t.metaKey||i.target!=="_self"&&i.target!==""||i.getAttribute("download")!=null)return!0;const{pathname:r,search:c,hash:l}=i;if(o){const a=r+c+l,d=i.getAttribute("href");if(!(d!=null&&d.startsWith("#"))&&d!==a)return!0}return e?!1:Bt(n,r)},Ht=(t,e={ignoreUrlWithExtension:!0,allowedExtensions:[],ignoreExternalUrl:!0})=>{const n=e.ignoreUrlWithExtension===!0&&Array.isArray(e.allowedExtensions)?e.allowedExtensions.map(o=>o.startsWith(".")?o:"."+o):[];return o=>{ye(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},$t=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,wt=(t,e)=>{var i;const n=new URL(t,e??((i=u.getWindow())==null?void 0:i.location.toString())),o=Object.fromEntries(n.searchParams.entries());let s=n.hash;return s.startsWith("#")&&(s=s.substring(1)),{pathname:n.pathname,search:o,hash:s===""?void 0:s}},ht=(t,e)=>{const n=wt(e);return t.set(n),t},Z=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},we=t=>t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//"),xe=t=>{const e=t.container.currentURL,n=e.iso(o=>wt(o),o=>{if(we(o.pathname))return Z(o);const s=new URL(o.pathname,e.value),i=s.origin+s.pathname;return Z({...o,pathname:i})});return{value:n,dispose:n.dispose}},ve=()=>{const t=u.getWindow(),e=(t==null?void 0:t.location.hash)===""?void 0:(t==null?void 0:t.location.hash.substring(1))??void 0;return{pathname:(t==null?void 0:t.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((t==null?void 0:t.location.search)??"").entries()),hash:e}},be=()=>{const t=u.prop(ve(),$t),e=u.getWindow(),n=()=>{let o=(e==null?void 0:e.location.hash)??"";o.startsWith("#")&&(o=o.substring(1));const s={pathname:(e==null?void 0:e.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((e==null?void 0:e.location.search)??"").entries()),hash:o===""?void 0:o};t.set(s)};return e==null||e.addEventListener("popstate",n),t.onDispose(()=>{e==null||e.removeEventListener("popstate",n)}),t.on(o=>{e==null||e.history.pushState({},"",Z(o))}),{value:t,dispose:t.dispose}},xt={mark:u.makeProviderMark("LocationProvider"),create:(t,e)=>{if(e.isBrowser())return be();if(e.isHeadless())return xe(e);throw new Error("Unknown context")}},Re=t=>{document.startViewTransition?document.startViewTransition(t):t()},zt=(t,...e)=>{if(typeof t=="string"||u.Signal.is(t))return zt({href:t},...e);const{href:n,withViewTransition:o,...s}=t;return u.Use(xt,i=>u.html.a(u.on.click(Ht(()=>(o==!0?Re(()=>{ht(i,u.Value.get(n))}):ht(i,u.Value.get(n)),!0),s)),u.attr.href(n),...e))},Ae={mark:u.makeProviderMark("Appearance"),create:()=>{const t=u.getWindow(),e=t!=null&&t.matchMedia!=null?t.matchMedia("(prefers-color-scheme: dark)"):void 0,n=(e==null?void 0:e.matches)??!1,o=u.prop(n?"dark":"light"),s=i=>o.set(i.matches?"dark":"light");return e==null||e.addEventListener("change",s),{value:o,dispose:()=>e==null?void 0:e.removeEventListener("change",s)}}},vt=(t,e)=>{if(typeof e=="function")return vt(t,{success:e});const n=e.failure??(r=>r.map(c=>`Error: ${c}`)),o=e.success,s=e.loading??(()=>u.Empty),i=e.notAsked??(()=>u.Empty);return u.OneOfType(u.Value.toSignal(t),{AsyncSuccess:r=>o(r.$.value),AsyncFailure:r=>n(r.$.error),Loading:r=>s(r.map(c=>c.previousValue)),NotAsked:i})},Ee=(t=10)=>u.WithElement(e=>u.OnDispose(R.delayed(()=>e==null?void 0:e.focus(),t))),Oe=(t=10)=>u.WithElement(e=>{const n=R.delayed(()=>e.select(),t);return u.OnDispose(n)}),Le=u.WithElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),u.OnDispose(n=>{n&&t.style.setProperty(":empty",e)})}),Se=t=>u.Portal("head > title",u.attr.innerText(t)),Te={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},Q={partial:new Map,full:new Map},j={partial:null,full:null};function ke(t){return j[t]==null&&(j[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=Q[t].get(n.target);o==null||o.set(n.isIntersecting)})},Te[t])),j[t]}const _t=(t,e)=>{const n=u.prop(!1);return u.Fragment(u.WithElement(o=>{const s=typeof IntersectionObserver<"u"?ke(t):null;return Q[t].set(o,n),s==null||s.observe(o),u.OnDispose(()=>{var i;n.dispose(),s==null||s.unobserve(o),Q[t].delete(o),Q[t].size===0&&((i=j[t])==null||i.disconnect(),j[t]=null)})}),u.renderableOfTNode(e(n)))},Ce=(t,e,n)=>_t(t,o=>u.When(o,e,n??(()=>u.Empty))),tt=Math.min,F=Math.max,et=Math.round,G=Math.floor,S=t=>({x:t,y:t}),We={left:"right",right:"left",bottom:"top",top:"bottom"},De={start:"end",end:"start"};function kt(t,e,n){return F(t,tt(e,n))}function it(t,e){return typeof t=="function"?t(e):t}function V(t){return t.split("-")[0]}function rt(t){return t.split("-")[1]}function It(t){return t==="x"?"y":"x"}function jt(t){return t==="y"?"height":"width"}function H(t){return["top","bottom"].includes(V(t))?"y":"x"}function qt(t){return It(H(t))}function Pe(t,e,n){n===void 0&&(n=!1);const o=rt(t),s=qt(t),i=jt(s);let r=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(r=nt(r)),[r,nt(r)]}function Fe(t){const e=nt(t);return[pt(t),e,pt(e)]}function pt(t){return t.replace(/start|end/g,e=>De[e])}function Ve(t,e,n){const o=["left","right"],s=["right","left"],i=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:o:e?o:s;case"left":case"right":return e?i:r;default:return[]}}function Me(t,e,n,o){const s=rt(t);let i=Ve(V(t),n==="start",o);return s&&(i=i.map(r=>r+"-"+s),e&&(i=i.concat(i.map(pt)))),i}function nt(t){return t.replace(/left|right|bottom|top/g,e=>We[e])}function Ne(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ue(t){return typeof t!="number"?Ne(t):{top:t,right:t,bottom:t,left:t}}function ot(t){const{x:e,y:n,width:o,height:s}=t;return{width:o,height:s,top:n,left:e,right:e+o,bottom:n+s,x:e,y:n}}function Ct(t,e,n){let{reference:o,floating:s}=t;const i=H(e),r=qt(e),c=jt(r),l=V(e),a=i==="y",d=o.x+o.width/2-s.width/2,f=o.y+o.height/2-s.height/2,p=o[c]/2-s[c]/2;let h;switch(l){case"top":h={x:d,y:o.y-s.height};break;case"bottom":h={x:d,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-s.width,y:f};break;default:h={x:o.x,y:o.y}}switch(rt(e)){case"start":h[r]-=p*(n&&a?-1:1);break;case"end":h[r]+=p*(n&&a?-1:1);break}return h}const Be=async(t,e,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:r}=n,c=i.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:f}=Ct(a,o,l),p=o,h={},m=0;for(let y=0;y<c.length;y++){const{name:w,fn:g}=c[y],{x,y:v,data:A,reset:b}=await g({x:d,y:f,initialPlacement:o,placement:p,strategy:s,middlewareData:h,rects:a,platform:r,elements:{reference:t,floating:e}});d=x??d,f=v??f,h={...h,[w]:{...h[w],...A}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(p=b.placement),b.rects&&(a=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):b.rects),{x:d,y:f}=Ct(a,p,l)),y=-1)}return{x:d,y:f,placement:p,strategy:s,middlewareData:h}};async function Yt(t,e){var n;e===void 0&&(e={});const{x:o,y:s,platform:i,rects:r,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=it(e,t),m=Ue(h),w=c[p?f==="floating"?"reference":"floating":f],g=ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:d,strategy:l})),x=f==="floating"?{x:o,y:s,width:r.floating.width,height:r.floating.height}:r.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),A=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},b=ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:l}):x);return{top:(g.top-b.top+m.top)/A.y,bottom:(b.bottom-g.bottom+m.bottom)/A.y,left:(g.left-b.left+m.left)/A.x,right:(b.right-g.right+m.right)/A.x}}const He=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:s,middlewareData:i,rects:r,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...w}=it(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=V(s),x=H(c),v=V(c)===c,A=await(l.isRTL==null?void 0:l.isRTL(a.floating)),b=p||(v||!y?[nt(c)]:Fe(c)),N=m!=="none";!p&&N&&b.push(...Me(c,y,m,A));const he=[c,...b],ut=await Yt(e,w),J=[];let _=((o=i.flip)==null?void 0:o.overflows)||[];if(d&&J.push(ut[g]),f){const P=Pe(s,r,A);J.push(ut[P[0]],ut[P[1]])}if(_=[..._,{placement:s,overflows:J}],!J.every(P=>P<=0)){var Ot,Lt;const P=(((Ot=i.flip)==null?void 0:Ot.index)||0)+1,Tt=he[P];if(Tt)return{data:{index:P,overflows:_},reset:{placement:Tt}};let I=(Lt=_.filter(U=>U.overflows[0]<=0).sort((U,C)=>U.overflows[1]-C.overflows[1])[0])==null?void 0:Lt.placement;if(!I)switch(h){case"bestFit":{var St;const U=(St=_.filter(C=>{if(N){const W=H(C.placement);return W===x||W==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(W=>W>0).reduce((W,pe)=>W+pe,0)]).sort((C,W)=>C[1]-W[1])[0])==null?void 0:St[0];U&&(I=U);break}case"initialPlacement":I=c;break}if(s!==I)return{reset:{placement:I}}}return{}}}};async function $e(t,e){const{placement:n,platform:o,elements:s}=t,i=await(o.isRTL==null?void 0:o.isRTL(s.floating)),r=V(n),c=rt(n),l=H(n)==="y",a=["left","top"].includes(r)?-1:1,d=i&&l?-1:1,f=it(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof m=="number"&&(h=c==="end"?m*-1:m),l?{x:h*d,y:p*a}:{x:p*a,y:h*d}}const ze=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:s,y:i,placement:r,middlewareData:c}=e,l=await $e(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:r}}}}},_e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:s}=e,{mainAxis:i=!0,crossAxis:r=!1,limiter:c={fn:w=>{let{x:g,y:x}=w;return{x:g,y:x}}},...l}=it(t,e),a={x:n,y:o},d=await Yt(e,l),f=H(V(s)),p=It(f);let h=a[p],m=a[f];if(i){const w=p==="y"?"top":"left",g=p==="y"?"bottom":"right",x=h+d[w],v=h-d[g];h=kt(x,h,v)}if(r){const w=f==="y"?"top":"left",g=f==="y"?"bottom":"right",x=m+d[w],v=m-d[g];m=kt(x,m,v)}const y=c.fn({...e,[p]:h,[f]:m});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[p]:i,[f]:r}}}}}};function ct(){return typeof window<"u"}function z(t){return Kt(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function k(t){var e;return(e=(Kt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Kt(t){return ct()?t instanceof Node||t instanceof E(t).Node:!1}function O(t){return ct()?t instanceof Element||t instanceof E(t).Element:!1}function T(t){return ct()?t instanceof HTMLElement||t instanceof E(t).HTMLElement:!1}function Wt(t){return!ct()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function K(t){const{overflow:e,overflowX:n,overflowY:o,display:s}=L(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(s)}function Ie(t){return["table","td","th"].includes(z(t))}function lt(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function bt(t){const e=Rt(),n=O(t)?L(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function je(t){let e=D(t);for(;T(e)&&!$(e);){if(bt(e))return e;if(lt(e))return null;e=D(e)}return null}function Rt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $(t){return["html","body","#document"].includes(z(t))}function L(t){return E(t).getComputedStyle(t)}function at(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function D(t){if(z(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Wt(t)&&t.host||k(t);return Wt(e)?e.host:e}function Xt(t){const e=D(t);return $(e)?t.ownerDocument?t.ownerDocument.body:t.body:T(e)&&K(e)?e:Xt(e)}function q(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=Xt(t),i=s===((o=t.ownerDocument)==null?void 0:o.body),r=E(s);if(i){const c=mt(r);return e.concat(r,r.visualViewport||[],K(s)?s:[],c&&n?q(c):[])}return e.concat(s,q(s,[],n))}function mt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Jt(t){const e=L(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const s=T(t),i=s?t.offsetWidth:n,r=s?t.offsetHeight:o,c=et(n)!==i||et(o)!==r;return c&&(n=i,o=r),{width:n,height:o,$:c}}function At(t){return O(t)?t:t.contextElement}function B(t){const e=At(t);if(!T(e))return S(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:i}=Jt(e);let r=(i?et(n.width):n.width)/o,c=(i?et(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const qe=S(0);function Gt(t){const e=E(t);return!Rt()||!e.visualViewport?qe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==E(t)?!1:e}function M(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=At(t);let r=S(1);e&&(o?O(o)&&(r=B(o)):r=B(t));const c=Ye(i,n,o)?Gt(i):S(0);let l=(s.left+c.x)/r.x,a=(s.top+c.y)/r.y,d=s.width/r.x,f=s.height/r.y;if(i){const p=E(i),h=o&&O(o)?E(o):o;let m=p,y=mt(m);for(;y&&o&&h!==m;){const w=B(y),g=y.getBoundingClientRect(),x=L(y),v=g.left+(y.clientLeft+parseFloat(x.paddingLeft))*w.x,A=g.top+(y.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,a*=w.y,d*=w.x,f*=w.y,l+=v,a+=A,m=E(y),y=mt(m)}}return ot({width:d,height:f,x:l,y:a})}function Et(t,e){const n=at(t).scrollLeft;return e?e.left+n:M(k(t)).left+n}function Qt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=o.left+e.scrollLeft-(n?0:Et(t,o)),i=o.top+e.scrollTop;return{x:s,y:i}}function Ke(t){let{elements:e,rect:n,offsetParent:o,strategy:s}=t;const i=s==="fixed",r=k(o),c=e?lt(e.floating):!1;if(o===r||c&&i)return n;let l={scrollLeft:0,scrollTop:0},a=S(1);const d=S(0),f=T(o);if((f||!f&&!i)&&((z(o)!=="body"||K(r))&&(l=at(o)),T(o))){const h=M(o);a=B(o),d.x=h.x+o.clientLeft,d.y=h.y+o.clientTop}const p=r&&!f&&!i?Qt(r,l,!0):S(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+d.x+p.x,y:n.y*a.y-l.scrollTop*a.y+d.y+p.y}}function Xe(t){return Array.from(t.getClientRects())}function Je(t){const e=k(t),n=at(t),o=t.ownerDocument.body,s=F(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=F(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Et(t);const c=-n.scrollTop;return L(o).direction==="rtl"&&(r+=F(e.clientWidth,o.clientWidth)-s),{width:s,height:i,x:r,y:c}}function Ge(t,e){const n=E(t),o=k(t),s=n.visualViewport;let i=o.clientWidth,r=o.clientHeight,c=0,l=0;if(s){i=s.width,r=s.height;const a=Rt();(!a||a&&e==="fixed")&&(c=s.offsetLeft,l=s.offsetTop)}return{width:i,height:r,x:c,y:l}}function Qe(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,s=n.left+t.clientLeft,i=T(t)?B(t):S(1),r=t.clientWidth*i.x,c=t.clientHeight*i.y,l=s*i.x,a=o*i.y;return{width:r,height:c,x:l,y:a}}function Dt(t,e,n){let o;if(e==="viewport")o=Ge(t,n);else if(e==="document")o=Je(k(t));else if(O(e))o=Qe(e,n);else{const s=Gt(t);o={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return ot(o)}function Zt(t,e){const n=D(t);return n===e||!O(n)||$(n)?!1:L(n).position==="fixed"||Zt(n,e)}function Ze(t,e){const n=e.get(t);if(n)return n;let o=q(t,[],!1).filter(c=>O(c)&&z(c)!=="body"),s=null;const i=L(t).position==="fixed";let r=i?D(t):t;for(;O(r)&&!$(r);){const c=L(r),l=bt(r);!l&&c.position==="fixed"&&(s=null),(i?!l&&!s:!l&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||K(r)&&!l&&Zt(t,r))?o=o.filter(d=>d!==r):s=c,r=D(r)}return e.set(t,o),o}function tn(t){let{element:e,boundary:n,rootBoundary:o,strategy:s}=t;const r=[...n==="clippingAncestors"?lt(e)?[]:Ze(e,this._c):[].concat(n),o],c=r[0],l=r.reduce((a,d)=>{const f=Dt(e,d,s);return a.top=F(f.top,a.top),a.right=tt(f.right,a.right),a.bottom=tt(f.bottom,a.bottom),a.left=F(f.left,a.left),a},Dt(e,c,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function en(t){const{width:e,height:n}=Jt(t);return{width:e,height:n}}function nn(t,e,n){const o=T(e),s=k(e),i=n==="fixed",r=M(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const l=S(0);if(o||!o&&!i)if((z(e)!=="body"||K(s))&&(c=at(e)),o){const p=M(e,!0,i,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else s&&(l.x=Et(s));const a=s&&!o&&!i?Qt(s,c):S(0),d=r.left+c.scrollLeft-l.x-a.x,f=r.top+c.scrollTop-l.y-a.y;return{x:d,y:f,width:r.width,height:r.height}}function dt(t){return L(t).position==="static"}function Pt(t,e){if(!T(t)||L(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return k(t)===n&&(n=n.ownerDocument.body),n}function te(t,e){const n=E(t);if(lt(t))return n;if(!T(t)){let s=D(t);for(;s&&!$(s);){if(O(s)&&!dt(s))return s;s=D(s)}return n}let o=Pt(t,e);for(;o&&Ie(o)&&dt(o);)o=Pt(o,e);return o&&$(o)&&dt(o)&&!bt(o)?n:o||je(t)||n}const on=async function(t){const e=this.getOffsetParent||te,n=this.getDimensions,o=await n(t.floating);return{reference:nn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function sn(t){return L(t).direction==="rtl"}const rn={convertOffsetParentRelativeRectToViewportRelativeRect:Ke,getDocumentElement:k,getClippingRect:tn,getOffsetParent:te,getElementRects:on,getClientRects:Xe,getDimensions:en,getScale:B,isElement:O,isRTL:sn};function cn(t,e){let n=null,o;const s=k(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function r(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const{left:a,top:d,width:f,height:p}=t.getBoundingClientRect();if(c||e(),!f||!p)return;const h=G(d),m=G(s.clientWidth-(a+f)),y=G(s.clientHeight-(d+p)),w=G(a),x={rootMargin:-h+"px "+-m+"px "+-y+"px "+-w+"px",threshold:F(0,tt(1,l))||1};let v=!0;function A(b){const N=b[0].intersectionRatio;if(N!==l){if(!v)return r();N?r(!1,N):o=setTimeout(()=>{r(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(A,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(t)}return r(!0),i}function ln(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=At(t),d=s||i?[...a?q(a):[],...q(e)]:[];d.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const f=a&&c?cn(a,n):null;let p=-1,h=null;r&&(h=new ResizeObserver(g=>{let[x]=g;x&&x.target===a&&h&&(h.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(e)})),n()}),a&&!l&&h.observe(a),h.observe(e));let m,y=l?M(t):null;l&&w();function w(){const g=M(t);y&&(g.x!==y.x||g.y!==y.y||g.width!==y.width||g.height!==y.height)&&n(),y=g,m=requestAnimationFrame(w)}return n(),()=>{var g;d.forEach(x=>{s&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const an=ze,un=_e,Ft=He,fn=(t,e,n)=>{const o=new Map,s={platform:rn,...n},i={...s.platform,_c:o};return Be(t,e,{...s,platform:i})},dn=({content:t,open:e,placement:n,offset:{mainAxis:o,crossAxis:s}={mainAxis:0,crossAxis:0}})=>u.WithBrowserCtx(i=>{const r=u.Value.toSignal(e),c=i.element;return u.When(r,()=>u.Portal("body",u.html.div(u.WithElement(l=>{const a=l;return a.style.position="absolute",u.OnDispose(ln(c,a,async()=>{const{x:d,y:f}=await fn(c,a,{placement:n,strategy:"absolute",middleware:[Ft(),an({mainAxis:o,crossAxis:s}),un(),Ft()]});a.style.top=`${f}px`,a.style.left=`${d}px`}))}),t())))}),ee=(t,e,n)=>{const o=u.prop(R.AsyncResult.notAsked),s=o.map(f=>R.AsyncResult.isSuccess(f)?f.value:void 0),i=o.map(f=>R.AsyncResult.isFailure(f)?f.error:void 0),r=o.map(f=>R.AsyncResult.isLoading(f));let c;const l=async f=>{c==null||c.abort(),c=new AbortController;const p=c.signal,h=o.get();o.set(R.AsyncResult.loading(R.AsyncResult.getOrUndefined(h)));try{const m=await e({request:f,abortSignal:p,previous:h});await Promise.resolve(),c=void 0,o.set(R.AsyncResult.success(m))}catch(m){c=void 0,o.set(R.AsyncResult.failure(n(m)))}},a=()=>l(u.Value.get(t)),d=()=>{c==null||c.abort(),c=void 0,o.dispose()};return o.onDispose(u.Value.on(t,l)),{status:o,value:s,error:i,loading:r,reload:a,dispose:d}},ne=(t,e)=>{const{status:n,dispose:o,reload:s}=t,{loading:i,failure:r,success:c}=e;return u.Fragment(u.OnDispose(o),vt(n,{loading:i!=null?l=>i(l,s):void 0,failure:r!=null?l=>r(l,s):void 0,success:l=>c(l,s)}))},hn=({request:t,load:e,mapError:n=o=>o})=>{const o=ee(t,e,n);return s=>ne(o,s)},oe=(t,e)=>{if(typeof e=="function")return oe(t,{success:e});const n=e.failure??(s=>u.Fragment(u.OnDispose(s.on(console.error)),s.map(i=>`Error: ${i}`))),o=e.success;return u.OneOfType(u.Value.toSignal(t),{Success:s=>o(s.$.value),Failure:s=>n(s.$.error)})},pn=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()});class X{constructor(e,n,o,s){ft(this,"equals",e=>R.nearEquals(this.left,e.left)&&R.nearEquals(this.top,e.top)&&R.nearEquals(this.width,e.width)&&R.nearEquals(this.height,e.height));this.left=e,this.top=n,this.width=o,this.height=s}static of({left:e=0,top:n=0,width:o=0,height:s=0}){return new X(e,n,o,s)}get right(){return this.left+this.width}get bottom(){return this.top+this.height}get center(){return{x:this.left+this.width/2,y:this.top+this.height/2}}get size(){return{width:this.width,height:this.height}}}function gt(t){const e=t.getBoundingClientRect();return X.of({top:e.top+window.scrollY,left:e.left+window.scrollX,width:e.width,height:e.height})}const se=t=>u.WithBrowserCtx(e=>{const{element:n}=e,o=u.prop(gt(n)),s=u.renderableOfTNode(t(o))(e),i=()=>{o.set(X.of(gt(n)))};let r;return typeof ResizeObserver=="function"&&(r=new ResizeObserver(i),r.observe(n)),u.OnDispose(c=>{r==null||r.disconnect(),s(c)})}),mn=t=>se(t),gn=t=>e=>{const n=u.getWindow(),o=u.prop({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0}),s=u.renderableOfTNode(t(o))(e),i=()=>{o.set({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0})};return n==null||n.addEventListener("resize",i),r=>{n==null||n.removeEventListener("resize",i),s(r)}},ie=(t,e)=>{const n=e.split("/").filter(s=>s!==""),o={};for(let s=0;s<t.length;s++){const i=t[s],r=n[s];if(!r&&i.type!=="catch-all")return null;if(i.type==="literal"){if(i.value!==r)return null}else if(i.type==="param")o[i.name]=r;else if(i.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}},re=t=>t.split("/").map(e=>e.startsWith(":")?{type:"param",name:e.slice(1)}:e==="*"?{type:"catch-all"}:{type:"literal",value:e}).filter(e=>e.type!=="literal"||e.value!==""),ce=t=>{const e=t.map(n=>{const o=re(n);return{route:n,segments:o}});return function(o){for(const{segments:s,route:i}of e){const r=ie(s,o);if(r)return{...r,route:i}}return null}},yn=t=>{const e=ce(Object.keys(t));return u.Use(xt,n=>{const o=n.map(s=>{const i=e(s.pathname);if(i==null)throw console.error("No route found for",s),new Error("No route found");return{params:i.params,route:i.route,path:i.path,search:s.search,hash:s.hash}});return u.OneOfTuple(o.map(s=>[s.route,s]),t)})},st=60*1e3,yt=60*st,Y=24*yt,Vt=7*Y,Mt=30*Y,wn=365*Y,xn=[{max:st*90,value:st,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:yt*36,value:yt,name:"hour",past:{singular:"an hour ago",plural:"{} hours ago"},future:{singular:"in an hour",plural:"in {} hours"}},{max:Y*10,value:Y,name:"day",past:{singular:"yesterday",plural:"{} days ago"},future:{singular:"tomorrow",plural:"in {} days"}},{max:Vt*6,value:Vt,name:"week",past:{singular:"last week",plural:"{} weeks ago"},future:{singular:"in a week",plural:"in {} weeks"}},{max:Mt*18,value:Mt,name:"month",past:{singular:"last month",plural:"{} months ago"},future:{singular:"in a month",plural:"in {} months"}},{max:1/0,value:wn,name:"year",past:{singular:"last year",plural:"{} years ago"},future:{singular:"in a year",plural:"in {} years"}}];function Nt(t,e,n,o){const s=Math.round(t/e);return s<=1?n:o.replace("{}",s.toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0}))}const le=(t=1e3)=>{const e=u.prop(new Date),n=R.interval(()=>e.set(new Date),t);return e.onDispose(n),e},ae=t=>{const e=Math.abs(t);if(e<st)return t<0?"just now":"in a moment";for(const n of xn)if(e<n.max)return t<0?Nt(e,n.value,n.past.singular,n.past.plural):Nt(e,n.value,n.future.singular,n.future.plural);throw new Error("unreachable")},ue=(t,{now:e,frequency:n=1e4}={})=>{const o=e!=null?u.Signal.is(e)?e.derive():u.prop(e):le(n),s=u.computedOf(t,o)((i,r)=>i.getTime()-r.getTime());return s.onDispose(()=>u.Value.dispose(o)),s},fe=(t,e={})=>{const n=ue(t,e),o=n.map(ae);return o.onDispose(n.dispose),o},vn=(t,e={})=>fe(t,e);class de extends u.Prop{constructor(){super(...arguments);ft(this,"tick",()=>this.update(n=>n+1))}}const bn=(t=0)=>new de(t,(e,n)=>e===n);exports.Anchor=zt;exports.Appearance=Ae;exports.AsyncResultView=vt;exports.AutoFocus=Ee;exports.AutoSelect=Oe;exports.ElementRect=se;exports.ElementSize=mn;exports.HTMLTitle=Se;exports.HiddenWhenEmpty=Le;exports.InViewport=_t;exports.Location=xt;exports.PopOver=dn;exports.Rect=X;exports.Resource=hn;exports.ResourceDisplay=ne;exports.ResultView=oe;exports.Router=yn;exports.SelectOnFocus=pn;exports.Ticker=de;exports.WhenInViewport=Ce;exports.WindowSize=gn;exports._checkExtensionCondition=Bt;exports._getExtension=Ut;exports._makeRouteMatcher=ce;exports._parseRouteSegments=re;exports.areLocationsEqual=$t;exports.getAbsoluteRect=gt;exports.handleAnchorClick=Ht;exports.locationFromURL=wt;exports.makeResource=ee;exports.matchesRoute=ie;exports.nowSignal=le;exports.relativeTime=vn;exports.relativeTimeMillisSignal=ue;exports.relativeTimeSignal=fe;exports.setLocationFromUrl=ht;exports.ticker=bn;exports.timeDiffToString=ae;exports.urlFromLocation=Z;
1
+ "use strict";var ge=Object.defineProperty;var ye=(t,e,n)=>e in t?ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ft=(t,e,n)=>ye(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tempots/dom"),R=require("@tempots/std"),Ut=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const n=e.split(".")||[];return n.length>1?"."+n.pop():void 0},Bt=(t,e)=>{const n=Ut(e);return n!=null&&(t.length===0||!t.some(o=>n==o))},we=(t,e,n,o)=>{let s=t.target;for(;s!=null&&!(s instanceof HTMLAnchorElement);)s=s.parentElement;if(s==null)return!0;const i=s;if(t.button!==0||t.ctrlKey||t.metaKey||i.target!=="_self"&&i.target!==""||i.getAttribute("download")!=null)return!0;const{pathname:r,search:c,hash:l}=i;if(o){const a=r+c+l,d=i.getAttribute("href");if(!(d!=null&&d.startsWith("#"))&&d!==a)return!0}return e?!1:Bt(n,r)},Ht=(t,e={ignoreUrlWithExtension:!0,allowedExtensions:[],ignoreExternalUrl:!0})=>{const n=e.ignoreUrlWithExtension===!0&&Array.isArray(e.allowedExtensions)?e.allowedExtensions.map(o=>o.startsWith(".")?o:"."+o):[];return o=>{we(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},$t=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,wt=(t,e)=>{var i;const n=new URL(t,e??((i=u.getWindow())==null?void 0:i.location.toString())),o=Object.fromEntries(n.searchParams.entries());let s=n.hash;return s.startsWith("#")&&(s=s.substring(1)),{pathname:n.pathname,search:o,hash:s===""?void 0:s}},ht=(t,e)=>{const n=wt(e);return t.set(n),t},Z=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},xe=t=>t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//"),ve=t=>{const e=t.container.currentURL,n=e.iso(o=>wt(o),o=>{if(xe(o.pathname))return Z(o);const s=new URL(o.pathname,e.value),i=s.origin+s.pathname;return Z({...o,pathname:i})});return{value:n,dispose:n.dispose}},be=()=>{const t=u.getWindow(),e=(t==null?void 0:t.location.hash)===""?void 0:(t==null?void 0:t.location.hash.substring(1))??void 0;return{pathname:(t==null?void 0:t.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((t==null?void 0:t.location.search)??"").entries()),hash:e}},Re=()=>{const t=u.prop(be(),$t),e=u.getWindow(),n=()=>{let o=(e==null?void 0:e.location.hash)??"";o.startsWith("#")&&(o=o.substring(1));const s={pathname:(e==null?void 0:e.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((e==null?void 0:e.location.search)??"").entries()),hash:o===""?void 0:o};t.set(s)};return e==null||e.addEventListener("popstate",n),t.onDispose(()=>{e==null||e.removeEventListener("popstate",n)}),t.on(o=>{e==null||e.history.pushState({},"",Z(o))}),{value:t,dispose:t.dispose}},xt={mark:u.makeProviderMark("LocationProvider"),create:(t,e)=>{if(e.isBrowser())return Re();if(e.isHeadless())return ve(e);throw new Error("Unknown context")}},Ae=t=>{document.startViewTransition?document.startViewTransition(t):t()},zt=(t,...e)=>{if(typeof t=="string"||u.Signal.is(t))return zt({href:t},...e);const{href:n,withViewTransition:o,...s}=t;return u.Use(xt,i=>u.html.a(u.on.click(Ht(()=>(o==!0?Ae(()=>{ht(i,u.Value.get(n))}):ht(i,u.Value.get(n)),!0),s)),u.attr.href(n),...e))},Ee={mark:u.makeProviderMark("Appearance"),create:()=>{const t=_t();return{value:t,dispose:t.dispose}}};function _t(){const t=u.getWindow(),e=t!=null&&t.matchMedia!=null?t.matchMedia("(prefers-color-scheme: dark)"):void 0,n=(e==null?void 0:e.matches)??!1,o=u.prop(n?"dark":"light"),s=i=>o.set(i.matches?"dark":"light");return e==null||e.addEventListener("change",s),o.onDispose(()=>e==null?void 0:e.removeEventListener("change",s)),o}const vt=(t,e)=>{if(typeof e=="function")return vt(t,{success:e});const n=e.failure??(r=>r.map(c=>`Error: ${c}`)),o=e.success,s=e.loading??(()=>u.Empty),i=e.notAsked??(()=>u.Empty);return u.OneOfType(u.Value.toSignal(t),{AsyncSuccess:r=>o(r.$.value),AsyncFailure:r=>n(r.$.error),Loading:r=>s(r.map(c=>c.previousValue)),NotAsked:i})},Oe=(t=10)=>u.WithElement(e=>u.OnDispose(R.delayed(()=>e==null?void 0:e.focus(),t))),Le=(t=10)=>u.WithElement(e=>{const n=R.delayed(()=>e.select(),t);return u.OnDispose(n)}),Se=u.WithElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),u.OnDispose(n=>{n&&t.style.setProperty(":empty",e)})}),Te=t=>u.Portal("head > title",u.attr.innerText(t)),ke={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},Q={partial:new Map,full:new Map},j={partial:null,full:null};function Ce(t){return j[t]==null&&(j[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=Q[t].get(n.target);o==null||o.set(n.isIntersecting)})},ke[t])),j[t]}const It=({mode:t="partial",once:e=!1},n)=>{const o=u.prop(!1);return u.Fragment(u.WithElement(s=>{const i=typeof IntersectionObserver<"u"?Ce(t):null;Q[t].set(s,o),i==null||i.observe(s);function r(){var l;i==null||i.unobserve(s),Q[t].delete(s),Q[t].size===0&&((l=j[t])==null||l.disconnect(),j[t]=null)}let c=null;return e&&(c=o.on(l=>{l&&r()})),u.OnDispose(()=>{o.dispose(),r(),c==null||c()})}),u.renderableOfTNode(n(o)))},De=(t,e,n)=>It(t,o=>u.When(o,e,n??(()=>u.Empty))),tt=Math.min,F=Math.max,et=Math.round,G=Math.floor,S=t=>({x:t,y:t}),We={left:"right",right:"left",bottom:"top",top:"bottom"},Pe={start:"end",end:"start"};function kt(t,e,n){return F(t,tt(e,n))}function it(t,e){return typeof t=="function"?t(e):t}function V(t){return t.split("-")[0]}function rt(t){return t.split("-")[1]}function jt(t){return t==="x"?"y":"x"}function qt(t){return t==="y"?"height":"width"}function H(t){return["top","bottom"].includes(V(t))?"y":"x"}function Yt(t){return jt(H(t))}function Fe(t,e,n){n===void 0&&(n=!1);const o=rt(t),s=Yt(t),i=qt(s);let r=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(r=nt(r)),[r,nt(r)]}function Ve(t){const e=nt(t);return[pt(t),e,pt(e)]}function pt(t){return t.replace(/start|end/g,e=>Pe[e])}function Me(t,e,n){const o=["left","right"],s=["right","left"],i=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:o:e?o:s;case"left":case"right":return e?i:r;default:return[]}}function Ne(t,e,n,o){const s=rt(t);let i=Me(V(t),n==="start",o);return s&&(i=i.map(r=>r+"-"+s),e&&(i=i.concat(i.map(pt)))),i}function nt(t){return t.replace(/left|right|bottom|top/g,e=>We[e])}function Ue(t){return{top:0,right:0,bottom:0,left:0,...t}}function Be(t){return typeof t!="number"?Ue(t):{top:t,right:t,bottom:t,left:t}}function ot(t){const{x:e,y:n,width:o,height:s}=t;return{width:o,height:s,top:n,left:e,right:e+o,bottom:n+s,x:e,y:n}}function Ct(t,e,n){let{reference:o,floating:s}=t;const i=H(e),r=Yt(e),c=qt(r),l=V(e),a=i==="y",d=o.x+o.width/2-s.width/2,f=o.y+o.height/2-s.height/2,p=o[c]/2-s[c]/2;let h;switch(l){case"top":h={x:d,y:o.y-s.height};break;case"bottom":h={x:d,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-s.width,y:f};break;default:h={x:o.x,y:o.y}}switch(rt(e)){case"start":h[r]-=p*(n&&a?-1:1);break;case"end":h[r]+=p*(n&&a?-1:1);break}return h}const He=async(t,e,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:r}=n,c=i.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:f}=Ct(a,o,l),p=o,h={},m=0;for(let y=0;y<c.length;y++){const{name:w,fn:g}=c[y],{x,y:v,data:A,reset:b}=await g({x:d,y:f,initialPlacement:o,placement:p,strategy:s,middlewareData:h,rects:a,platform:r,elements:{reference:t,floating:e}});d=x??d,f=v??f,h={...h,[w]:{...h[w],...A}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(p=b.placement),b.rects&&(a=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):b.rects),{x:d,y:f}=Ct(a,p,l)),y=-1)}return{x:d,y:f,placement:p,strategy:s,middlewareData:h}};async function Kt(t,e){var n;e===void 0&&(e={});const{x:o,y:s,platform:i,rects:r,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=it(e,t),m=Be(h),w=c[p?f==="floating"?"reference":"floating":f],g=ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:d,strategy:l})),x=f==="floating"?{x:o,y:s,width:r.floating.width,height:r.floating.height}:r.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),A=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},b=ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:l}):x);return{top:(g.top-b.top+m.top)/A.y,bottom:(b.bottom-g.bottom+m.bottom)/A.y,left:(g.left-b.left+m.left)/A.x,right:(b.right-g.right+m.right)/A.x}}const $e=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:s,middlewareData:i,rects:r,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...w}=it(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=V(s),x=H(c),v=V(c)===c,A=await(l.isRTL==null?void 0:l.isRTL(a.floating)),b=p||(v||!y?[nt(c)]:Ve(c)),N=m!=="none";!p&&N&&b.push(...Ne(c,y,m,A));const pe=[c,...b],ut=await Kt(e,w),J=[];let _=((o=i.flip)==null?void 0:o.overflows)||[];if(d&&J.push(ut[g]),f){const P=Fe(s,r,A);J.push(ut[P[0]],ut[P[1]])}if(_=[..._,{placement:s,overflows:J}],!J.every(P=>P<=0)){var Ot,Lt;const P=(((Ot=i.flip)==null?void 0:Ot.index)||0)+1,Tt=pe[P];if(Tt)return{data:{index:P,overflows:_},reset:{placement:Tt}};let I=(Lt=_.filter(U=>U.overflows[0]<=0).sort((U,C)=>U.overflows[1]-C.overflows[1])[0])==null?void 0:Lt.placement;if(!I)switch(h){case"bestFit":{var St;const U=(St=_.filter(C=>{if(N){const D=H(C.placement);return D===x||D==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(D=>D>0).reduce((D,me)=>D+me,0)]).sort((C,D)=>C[1]-D[1])[0])==null?void 0:St[0];U&&(I=U);break}case"initialPlacement":I=c;break}if(s!==I)return{reset:{placement:I}}}return{}}}};async function ze(t,e){const{placement:n,platform:o,elements:s}=t,i=await(o.isRTL==null?void 0:o.isRTL(s.floating)),r=V(n),c=rt(n),l=H(n)==="y",a=["left","top"].includes(r)?-1:1,d=i&&l?-1:1,f=it(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof m=="number"&&(h=c==="end"?m*-1:m),l?{x:h*d,y:p*a}:{x:p*a,y:h*d}}const _e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:s,y:i,placement:r,middlewareData:c}=e,l=await ze(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:r}}}}},Ie=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:s}=e,{mainAxis:i=!0,crossAxis:r=!1,limiter:c={fn:w=>{let{x:g,y:x}=w;return{x:g,y:x}}},...l}=it(t,e),a={x:n,y:o},d=await Kt(e,l),f=H(V(s)),p=jt(f);let h=a[p],m=a[f];if(i){const w=p==="y"?"top":"left",g=p==="y"?"bottom":"right",x=h+d[w],v=h-d[g];h=kt(x,h,v)}if(r){const w=f==="y"?"top":"left",g=f==="y"?"bottom":"right",x=m+d[w],v=m-d[g];m=kt(x,m,v)}const y=c.fn({...e,[p]:h,[f]:m});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[p]:i,[f]:r}}}}}};function ct(){return typeof window<"u"}function z(t){return Xt(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function k(t){var e;return(e=(Xt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Xt(t){return ct()?t instanceof Node||t instanceof E(t).Node:!1}function O(t){return ct()?t instanceof Element||t instanceof E(t).Element:!1}function T(t){return ct()?t instanceof HTMLElement||t instanceof E(t).HTMLElement:!1}function Dt(t){return!ct()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function K(t){const{overflow:e,overflowX:n,overflowY:o,display:s}=L(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(s)}function je(t){return["table","td","th"].includes(z(t))}function lt(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function bt(t){const e=Rt(),n=O(t)?L(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function qe(t){let e=W(t);for(;T(e)&&!$(e);){if(bt(e))return e;if(lt(e))return null;e=W(e)}return null}function Rt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $(t){return["html","body","#document"].includes(z(t))}function L(t){return E(t).getComputedStyle(t)}function at(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function W(t){if(z(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Dt(t)&&t.host||k(t);return Dt(e)?e.host:e}function Jt(t){const e=W(t);return $(e)?t.ownerDocument?t.ownerDocument.body:t.body:T(e)&&K(e)?e:Jt(e)}function q(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=Jt(t),i=s===((o=t.ownerDocument)==null?void 0:o.body),r=E(s);if(i){const c=mt(r);return e.concat(r,r.visualViewport||[],K(s)?s:[],c&&n?q(c):[])}return e.concat(s,q(s,[],n))}function mt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Gt(t){const e=L(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const s=T(t),i=s?t.offsetWidth:n,r=s?t.offsetHeight:o,c=et(n)!==i||et(o)!==r;return c&&(n=i,o=r),{width:n,height:o,$:c}}function At(t){return O(t)?t:t.contextElement}function B(t){const e=At(t);if(!T(e))return S(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:i}=Gt(e);let r=(i?et(n.width):n.width)/o,c=(i?et(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const Ye=S(0);function Qt(t){const e=E(t);return!Rt()||!e.visualViewport?Ye:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ke(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==E(t)?!1:e}function M(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=At(t);let r=S(1);e&&(o?O(o)&&(r=B(o)):r=B(t));const c=Ke(i,n,o)?Qt(i):S(0);let l=(s.left+c.x)/r.x,a=(s.top+c.y)/r.y,d=s.width/r.x,f=s.height/r.y;if(i){const p=E(i),h=o&&O(o)?E(o):o;let m=p,y=mt(m);for(;y&&o&&h!==m;){const w=B(y),g=y.getBoundingClientRect(),x=L(y),v=g.left+(y.clientLeft+parseFloat(x.paddingLeft))*w.x,A=g.top+(y.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,a*=w.y,d*=w.x,f*=w.y,l+=v,a+=A,m=E(y),y=mt(m)}}return ot({width:d,height:f,x:l,y:a})}function Et(t,e){const n=at(t).scrollLeft;return e?e.left+n:M(k(t)).left+n}function Zt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=o.left+e.scrollLeft-(n?0:Et(t,o)),i=o.top+e.scrollTop;return{x:s,y:i}}function Xe(t){let{elements:e,rect:n,offsetParent:o,strategy:s}=t;const i=s==="fixed",r=k(o),c=e?lt(e.floating):!1;if(o===r||c&&i)return n;let l={scrollLeft:0,scrollTop:0},a=S(1);const d=S(0),f=T(o);if((f||!f&&!i)&&((z(o)!=="body"||K(r))&&(l=at(o)),T(o))){const h=M(o);a=B(o),d.x=h.x+o.clientLeft,d.y=h.y+o.clientTop}const p=r&&!f&&!i?Zt(r,l,!0):S(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+d.x+p.x,y:n.y*a.y-l.scrollTop*a.y+d.y+p.y}}function Je(t){return Array.from(t.getClientRects())}function Ge(t){const e=k(t),n=at(t),o=t.ownerDocument.body,s=F(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=F(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Et(t);const c=-n.scrollTop;return L(o).direction==="rtl"&&(r+=F(e.clientWidth,o.clientWidth)-s),{width:s,height:i,x:r,y:c}}function Qe(t,e){const n=E(t),o=k(t),s=n.visualViewport;let i=o.clientWidth,r=o.clientHeight,c=0,l=0;if(s){i=s.width,r=s.height;const a=Rt();(!a||a&&e==="fixed")&&(c=s.offsetLeft,l=s.offsetTop)}return{width:i,height:r,x:c,y:l}}function Ze(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,s=n.left+t.clientLeft,i=T(t)?B(t):S(1),r=t.clientWidth*i.x,c=t.clientHeight*i.y,l=s*i.x,a=o*i.y;return{width:r,height:c,x:l,y:a}}function Wt(t,e,n){let o;if(e==="viewport")o=Qe(t,n);else if(e==="document")o=Ge(k(t));else if(O(e))o=Ze(e,n);else{const s=Qt(t);o={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return ot(o)}function te(t,e){const n=W(t);return n===e||!O(n)||$(n)?!1:L(n).position==="fixed"||te(n,e)}function tn(t,e){const n=e.get(t);if(n)return n;let o=q(t,[],!1).filter(c=>O(c)&&z(c)!=="body"),s=null;const i=L(t).position==="fixed";let r=i?W(t):t;for(;O(r)&&!$(r);){const c=L(r),l=bt(r);!l&&c.position==="fixed"&&(s=null),(i?!l&&!s:!l&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||K(r)&&!l&&te(t,r))?o=o.filter(d=>d!==r):s=c,r=W(r)}return e.set(t,o),o}function en(t){let{element:e,boundary:n,rootBoundary:o,strategy:s}=t;const r=[...n==="clippingAncestors"?lt(e)?[]:tn(e,this._c):[].concat(n),o],c=r[0],l=r.reduce((a,d)=>{const f=Wt(e,d,s);return a.top=F(f.top,a.top),a.right=tt(f.right,a.right),a.bottom=tt(f.bottom,a.bottom),a.left=F(f.left,a.left),a},Wt(e,c,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function nn(t){const{width:e,height:n}=Gt(t);return{width:e,height:n}}function on(t,e,n){const o=T(e),s=k(e),i=n==="fixed",r=M(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const l=S(0);if(o||!o&&!i)if((z(e)!=="body"||K(s))&&(c=at(e)),o){const p=M(e,!0,i,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else s&&(l.x=Et(s));const a=s&&!o&&!i?Zt(s,c):S(0),d=r.left+c.scrollLeft-l.x-a.x,f=r.top+c.scrollTop-l.y-a.y;return{x:d,y:f,width:r.width,height:r.height}}function dt(t){return L(t).position==="static"}function Pt(t,e){if(!T(t)||L(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return k(t)===n&&(n=n.ownerDocument.body),n}function ee(t,e){const n=E(t);if(lt(t))return n;if(!T(t)){let s=W(t);for(;s&&!$(s);){if(O(s)&&!dt(s))return s;s=W(s)}return n}let o=Pt(t,e);for(;o&&je(o)&&dt(o);)o=Pt(o,e);return o&&$(o)&&dt(o)&&!bt(o)?n:o||qe(t)||n}const sn=async function(t){const e=this.getOffsetParent||ee,n=this.getDimensions,o=await n(t.floating);return{reference:on(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function rn(t){return L(t).direction==="rtl"}const cn={convertOffsetParentRelativeRectToViewportRelativeRect:Xe,getDocumentElement:k,getClippingRect:en,getOffsetParent:ee,getElementRects:sn,getClientRects:Je,getDimensions:nn,getScale:B,isElement:O,isRTL:rn};function ln(t,e){let n=null,o;const s=k(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function r(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const{left:a,top:d,width:f,height:p}=t.getBoundingClientRect();if(c||e(),!f||!p)return;const h=G(d),m=G(s.clientWidth-(a+f)),y=G(s.clientHeight-(d+p)),w=G(a),x={rootMargin:-h+"px "+-m+"px "+-y+"px "+-w+"px",threshold:F(0,tt(1,l))||1};let v=!0;function A(b){const N=b[0].intersectionRatio;if(N!==l){if(!v)return r();N?r(!1,N):o=setTimeout(()=>{r(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(A,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(t)}return r(!0),i}function an(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=At(t),d=s||i?[...a?q(a):[],...q(e)]:[];d.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const f=a&&c?ln(a,n):null;let p=-1,h=null;r&&(h=new ResizeObserver(g=>{let[x]=g;x&&x.target===a&&h&&(h.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(e)})),n()}),a&&!l&&h.observe(a),h.observe(e));let m,y=l?M(t):null;l&&w();function w(){const g=M(t);y&&(g.x!==y.x||g.y!==y.y||g.width!==y.width||g.height!==y.height)&&n(),y=g,m=requestAnimationFrame(w)}return n(),()=>{var g;d.forEach(x=>{s&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const un=_e,fn=Ie,Ft=$e,dn=(t,e,n)=>{const o=new Map,s={platform:cn,...n},i={...s.platform,_c:o};return He(t,e,{...s,platform:i})},hn=({content:t,open:e,placement:n,offset:{mainAxis:o,crossAxis:s}={mainAxis:0,crossAxis:0}})=>u.WithBrowserCtx(i=>{const r=u.Value.toSignal(e),c=i.element;return u.When(r,()=>u.Portal("body",u.html.div(u.WithElement(l=>{const a=l;return a.style.position="absolute",u.OnDispose(an(c,a,async()=>{const{x:d,y:f}=await dn(c,a,{placement:n,strategy:"absolute",middleware:[Ft(),un({mainAxis:o,crossAxis:s}),fn(),Ft()]});a.style.top=`${f}px`,a.style.left=`${d}px`}))}),t())))}),ne=(t,e,n)=>{const o=u.prop(R.AsyncResult.notAsked),s=o.map(f=>R.AsyncResult.isSuccess(f)?f.value:void 0),i=o.map(f=>R.AsyncResult.isFailure(f)?f.error:void 0),r=o.map(f=>R.AsyncResult.isLoading(f));let c;const l=async f=>{c==null||c.abort(),c=new AbortController;const p=c.signal,h=o.get();o.set(R.AsyncResult.loading(R.AsyncResult.getOrUndefined(h)));try{const m=await e({request:f,abortSignal:p,previous:h});await Promise.resolve(),c=void 0,o.set(R.AsyncResult.success(m))}catch(m){c=void 0,o.set(R.AsyncResult.failure(n(m)))}},a=()=>l(u.Value.get(t)),d=()=>{c==null||c.abort(),c=void 0,o.dispose()};return o.onDispose(u.Value.on(t,l)),{status:o,value:s,error:i,loading:r,reload:a,dispose:d}},oe=(t,e)=>{const{status:n,dispose:o,reload:s}=t,{loading:i,failure:r,success:c}=e;return u.Fragment(u.OnDispose(o),vt(n,{loading:i!=null?l=>i(l,s):void 0,failure:r!=null?l=>r(l,s):void 0,success:l=>c(l,s)}))},pn=({request:t,load:e,mapError:n=o=>o})=>{const o=ne(t,e,n);return s=>oe(o,s)},se=(t,e)=>{if(typeof e=="function")return se(t,{success:e});const n=e.failure??(s=>u.Fragment(u.OnDispose(s.on(console.error)),s.map(i=>`Error: ${i}`))),o=e.success;return u.OneOfType(u.Value.toSignal(t),{Success:s=>o(s.$.value),Failure:s=>n(s.$.error)})},mn=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()});class X{constructor(e,n,o,s){ft(this,"equals",e=>R.nearEquals(this.left,e.left)&&R.nearEquals(this.top,e.top)&&R.nearEquals(this.width,e.width)&&R.nearEquals(this.height,e.height));this.left=e,this.top=n,this.width=o,this.height=s}static of({left:e=0,top:n=0,width:o=0,height:s=0}){return new X(e,n,o,s)}get right(){return this.left+this.width}get bottom(){return this.top+this.height}get center(){return{x:this.left+this.width/2,y:this.top+this.height/2}}get size(){return{width:this.width,height:this.height}}}function gt(t){const e=t.getBoundingClientRect();return X.of({top:e.top+window.scrollY,left:e.left+window.scrollX,width:e.width,height:e.height})}const ie=t=>u.WithBrowserCtx(e=>{const{element:n}=e,o=u.prop(gt(n)),s=u.renderableOfTNode(t(o))(e),i=()=>{o.set(X.of(gt(n)))};let r;return typeof ResizeObserver=="function"&&(r=new ResizeObserver(i),r.observe(n)),u.OnDispose(c=>{r==null||r.disconnect(),s(c)})}),gn=t=>ie(t),yn=t=>e=>{const n=u.getWindow(),o=u.prop({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0}),s=u.renderableOfTNode(t(o))(e),i=()=>{o.set({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0})};return n==null||n.addEventListener("resize",i),r=>{n==null||n.removeEventListener("resize",i),s(r)}},re=(t,e)=>{const n=e.split("/").filter(s=>s!==""),o={};for(let s=0;s<t.length;s++){const i=t[s],r=n[s];if(!r&&i.type!=="catch-all")return null;if(i.type==="literal"){if(i.value!==r)return null}else if(i.type==="param")o[i.name]=r;else if(i.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}},ce=t=>t.split("/").map(e=>e.startsWith(":")?{type:"param",name:e.slice(1)}:e==="*"?{type:"catch-all"}:{type:"literal",value:e}).filter(e=>e.type!=="literal"||e.value!==""),le=t=>{const e=t.map(n=>{const o=ce(n);return{route:n,segments:o}});return function(o){for(const{segments:s,route:i}of e){const r=re(s,o);if(r)return{...r,route:i}}return null}},wn=t=>{const e=le(Object.keys(t));return u.Use(xt,n=>{const o=n.map(s=>{const i=e(s.pathname);if(i==null)throw console.error("No route found for",s),new Error("No route found");return{params:i.params,route:i.route,path:i.path,search:s.search,hash:s.hash}});return u.OneOfTuple(o.map(s=>[s.route,s]),t)})},st=60*1e3,yt=60*st,Y=24*yt,Vt=7*Y,Mt=30*Y,xn=365*Y,vn=[{max:st*90,value:st,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:yt*36,value:yt,name:"hour",past:{singular:"an hour ago",plural:"{} hours ago"},future:{singular:"in an hour",plural:"in {} hours"}},{max:Y*10,value:Y,name:"day",past:{singular:"yesterday",plural:"{} days ago"},future:{singular:"tomorrow",plural:"in {} days"}},{max:Vt*6,value:Vt,name:"week",past:{singular:"last week",plural:"{} weeks ago"},future:{singular:"in a week",plural:"in {} weeks"}},{max:Mt*18,value:Mt,name:"month",past:{singular:"last month",plural:"{} months ago"},future:{singular:"in a month",plural:"in {} months"}},{max:1/0,value:xn,name:"year",past:{singular:"last year",plural:"{} years ago"},future:{singular:"in a year",plural:"in {} years"}}];function Nt(t,e,n,o){const s=Math.round(t/e);return s<=1?n:o.replace("{}",s.toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0}))}const ae=(t=1e3)=>{const e=u.prop(new Date),n=R.interval(()=>e.set(new Date),t);return e.onDispose(n),e},ue=t=>{const e=Math.abs(t);if(e<st)return t<0?"just now":"in a moment";for(const n of vn)if(e<n.max)return t<0?Nt(e,n.value,n.past.singular,n.past.plural):Nt(e,n.value,n.future.singular,n.future.plural);throw new Error("unreachable")},fe=(t,{now:e,frequency:n=1e4}={})=>{const o=e!=null?u.Signal.is(e)?e.derive():u.prop(e):ae(n),s=u.computedOf(t,o)((i,r)=>i.getTime()-r.getTime());return s.onDispose(()=>u.Value.dispose(o)),s},de=(t,e={})=>{const n=fe(t,e),o=n.map(ue);return o.onDispose(n.dispose),o},bn=(t,e={})=>de(t,e);class he extends u.Prop{constructor(){super(...arguments);ft(this,"tick",()=>this.update(n=>n+1))}}const Rn=(t=0)=>new he(t,(e,n)=>e===n);exports.Anchor=zt;exports.Appearance=Ee;exports.AsyncResultView=vt;exports.AutoFocus=Oe;exports.AutoSelect=Le;exports.ElementRect=ie;exports.ElementSize=gn;exports.HTMLTitle=Te;exports.HiddenWhenEmpty=Se;exports.InViewport=It;exports.Location=xt;exports.PopOver=hn;exports.Rect=X;exports.Resource=pn;exports.ResourceDisplay=oe;exports.ResultView=se;exports.Router=wn;exports.SelectOnFocus=mn;exports.Ticker=he;exports.WhenInViewport=De;exports.WindowSize=yn;exports._checkExtensionCondition=Bt;exports._getExtension=Ut;exports._makeRouteMatcher=le;exports._parseRouteSegments=ce;exports.areLocationsEqual=$t;exports.getAbsoluteRect=gt;exports.handleAnchorClick=Ht;exports.locationFromURL=wt;exports.makeResource=ne;exports.matchesRoute=re;exports.nowSignal=ae;exports.relativeTime=bn;exports.relativeTimeMillisSignal=fe;exports.relativeTimeSignal=de;exports.setLocationFromUrl=ht;exports.ticker=Rn;exports.timeDiffToString=ue;exports.urlFromLocation=Z;exports.useAppearence=_t;
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var ge = Object.defineProperty;
2
2
  var ye = (t, e, n) => e in t ? ge(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var pt = (t, e, n) => ye(t, typeof e != "symbol" ? e + "" : e, n);
3
+ var mt = (t, e, n) => ye(t, typeof e != "symbol" ? e + "" : e, n);
4
4
  import { getWindow as J, prop as W, makeProviderMark as _t, Signal as It, Use as jt, html as Yt, on as qt, Value as D, attr as Kt, Empty as yt, OneOfType as Xt, WithElement as G, OnDispose as F, Portal as Jt, Fragment as At, renderableOfTNode as Rt, When as Gt, WithBrowserCtx as Qt, OneOfTuple as we, computedOf as xe, Prop as ve } from "@tempots/dom";
5
5
  import { delayed as Zt, AsyncResult as C, nearEquals as tt, interval as be } from "@tempots/std";
6
6
  const Ae = (t) => {
@@ -127,16 +127,21 @@ const Ae = (t) => {
127
127
  Kt.href(n),
128
128
  ...e
129
129
  ));
130
- }, Fn = {
130
+ }, Mn = {
131
131
  mark: _t("Appearance"),
132
132
  create: () => {
133
- const t = J(), e = t != null && t.matchMedia != null ? t.matchMedia("(prefers-color-scheme: dark)") : void 0, n = (e == null ? void 0 : e.matches) ?? !1, o = W(n ? "dark" : "light"), s = (i) => o.set(i.matches ? "dark" : "light");
134
- return e == null || e.addEventListener("change", s), {
135
- value: o,
136
- dispose: () => e == null ? void 0 : e.removeEventListener("change", s)
133
+ const t = We();
134
+ return {
135
+ value: t,
136
+ dispose: t.dispose
137
137
  };
138
138
  }
139
- }, ne = (t, e) => {
139
+ };
140
+ function We() {
141
+ const t = J(), e = t != null && t.matchMedia != null ? t.matchMedia("(prefers-color-scheme: dark)") : void 0, n = (e == null ? void 0 : e.matches) ?? !1, o = W(n ? "dark" : "light"), s = (i) => o.set(i.matches ? "dark" : "light");
142
+ return e == null || e.addEventListener("change", s), o.onDispose(() => e == null ? void 0 : e.removeEventListener("change", s)), o;
143
+ }
144
+ const ne = (t, e) => {
140
145
  if (typeof e == "function")
141
146
  return ne(t, { success: e });
142
147
  const n = e.failure ?? ((r) => r.map((c) => `Error: ${c}`)), o = e.success, s = e.loading ?? (() => yt), i = e.notAsked ?? (() => yt);
@@ -146,15 +151,15 @@ const Ae = (t) => {
146
151
  Loading: (r) => s(r.map((c) => c.previousValue)),
147
152
  NotAsked: i
148
153
  });
149
- }, Mn = (t = 10) => G((e) => F(Zt(() => e == null ? void 0 : e.focus(), t))), Vn = (t = 10) => G((e) => {
154
+ }, Vn = (t = 10) => G((e) => F(Zt(() => e == null ? void 0 : e.focus(), t))), Nn = (t = 10) => G((e) => {
150
155
  const n = Zt(() => e.select(), t);
151
156
  return F(n);
152
- }), Nn = G((t) => {
157
+ }), $n = G((t) => {
153
158
  const e = t.style.getPropertyValue(":empty");
154
159
  return t.style.setProperty(":empty", "display:none"), F((n) => {
155
160
  n && t.style.setProperty(":empty", e);
156
161
  });
157
- }), $n = (t) => Jt("head > title", Kt.innerText(t)), We = {
162
+ }), Bn = (t) => Jt("head > title", Kt.innerText(t)), Fe = {
158
163
  partial: {
159
164
  root: null,
160
165
  rootMargin: "0px",
@@ -172,35 +177,42 @@ const Ae = (t) => {
172
177
  partial: null,
173
178
  full: null
174
179
  };
175
- function Fe(t) {
180
+ function Me(t) {
176
181
  return q[t] == null && (q[t] = new IntersectionObserver((e) => {
177
182
  e.forEach((n) => {
178
183
  const o = nt[t].get(n.target);
179
184
  o == null || o.set(n.isIntersecting);
180
185
  });
181
- }, We[t])), q[t];
186
+ }, Fe[t])), q[t];
182
187
  }
183
- const Me = (t, e) => {
184
- const n = W(!1);
188
+ const Ve = ({ mode: t = "partial", once: e = !1 }, n) => {
189
+ const o = W(!1);
185
190
  return At(
186
- G((o) => {
187
- const s = typeof IntersectionObserver < "u" ? Fe(t) : null;
188
- return nt[t].set(o, n), s == null || s.observe(o), F(() => {
189
- var i;
190
- n.dispose(), s == null || s.unobserve(o), nt[t].delete(o), nt[t].size === 0 && ((i = q[t]) == null || i.disconnect(), q[t] = null);
191
+ G((s) => {
192
+ const i = typeof IntersectionObserver < "u" ? Me(t) : null;
193
+ nt[t].set(s, o), i == null || i.observe(s);
194
+ function r() {
195
+ var l;
196
+ i == null || i.unobserve(s), nt[t].delete(s), nt[t].size === 0 && ((l = q[t]) == null || l.disconnect(), q[t] = null);
197
+ }
198
+ let c = null;
199
+ return e && (c = o.on((l) => {
200
+ l && r();
201
+ })), F(() => {
202
+ o.dispose(), r(), c == null || c();
191
203
  });
192
204
  }),
193
- Rt(e(n))
205
+ Rt(n(o))
194
206
  );
195
- }, Bn = (t, e, n) => Me(t, (o) => Gt(o, e, n ?? (() => yt))), ot = Math.min, V = Math.max, st = Math.round, et = Math.floor, L = (t) => ({
207
+ }, Un = (t, e, n) => Ve(t, (o) => Gt(o, e, n ?? (() => yt))), ot = Math.min, V = Math.max, st = Math.round, et = Math.floor, L = (t) => ({
196
208
  x: t,
197
209
  y: t
198
- }), Ve = {
210
+ }), Ne = {
199
211
  left: "right",
200
212
  right: "left",
201
213
  bottom: "top",
202
214
  top: "bottom"
203
- }, Ne = {
215
+ }, $e = {
204
216
  start: "end",
205
217
  end: "start"
206
218
  };
@@ -228,20 +240,20 @@ function z(t) {
228
240
  function ie(t) {
229
241
  return oe(z(t));
230
242
  }
231
- function $e(t, e, n) {
243
+ function Be(t, e, n) {
232
244
  n === void 0 && (n = !1);
233
245
  const o = at(t), s = ie(t), i = se(s);
234
246
  let r = s === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
235
247
  return e.reference[i] > e.floating[i] && (r = it(r)), [r, it(r)];
236
248
  }
237
- function Be(t) {
249
+ function Ue(t) {
238
250
  const e = it(t);
239
251
  return [xt(t), e, xt(e)];
240
252
  }
241
253
  function xt(t) {
242
- return t.replace(/start|end/g, (e) => Ne[e]);
254
+ return t.replace(/start|end/g, (e) => $e[e]);
243
255
  }
244
- function Ue(t, e, n) {
256
+ function He(t, e, n) {
245
257
  const o = ["left", "right"], s = ["right", "left"], i = ["top", "bottom"], r = ["bottom", "top"];
246
258
  switch (t) {
247
259
  case "top":
@@ -254,15 +266,15 @@ function Ue(t, e, n) {
254
266
  return [];
255
267
  }
256
268
  }
257
- function He(t, e, n, o) {
269
+ function ze(t, e, n, o) {
258
270
  const s = at(t);
259
- let i = Ue(N(t), n === "start", o);
271
+ let i = He(N(t), n === "start", o);
260
272
  return s && (i = i.map((r) => r + "-" + s), e && (i = i.concat(i.map(xt)))), i;
261
273
  }
262
274
  function it(t) {
263
- return t.replace(/left|right|bottom|top/g, (e) => Ve[e]);
275
+ return t.replace(/left|right|bottom|top/g, (e) => Ne[e]);
264
276
  }
265
- function ze(t) {
277
+ function _e(t) {
266
278
  return {
267
279
  top: 0,
268
280
  right: 0,
@@ -271,8 +283,8 @@ function ze(t) {
271
283
  ...t
272
284
  };
273
285
  }
274
- function _e(t) {
275
- return typeof t != "number" ? ze(t) : {
286
+ function Ie(t) {
287
+ return typeof t != "number" ? _e(t) : {
276
288
  top: t,
277
289
  right: t,
278
290
  bottom: t,
@@ -345,7 +357,7 @@ function Ft(t, e, n) {
345
357
  }
346
358
  return h;
347
359
  }
348
- const Ie = async (t, e, n) => {
360
+ const je = async (t, e, n) => {
349
361
  const {
350
362
  placement: o = "bottom",
351
363
  strategy: s = "absolute",
@@ -359,17 +371,17 @@ const Ie = async (t, e, n) => {
359
371
  }), {
360
372
  x: f,
361
373
  y: u
362
- } = Ft(a, o, l), d = o, h = {}, m = 0;
374
+ } = Ft(a, o, l), d = o, h = {}, p = 0;
363
375
  for (let g = 0; g < c.length; g++) {
364
376
  const {
365
377
  name: y,
366
- fn: p
378
+ fn: m
367
379
  } = c[g], {
368
380
  x: w,
369
381
  y: x,
370
382
  data: b,
371
383
  reset: v
372
- } = await p({
384
+ } = await m({
373
385
  x: f,
374
386
  y: u,
375
387
  initialPlacement: o,
@@ -389,7 +401,7 @@ const Ie = async (t, e, n) => {
389
401
  ...h[y],
390
402
  ...b
391
403
  }
392
- }, v && m <= 50 && (m++, typeof v == "object" && (v.placement && (d = v.placement), v.rects && (a = v.rects === !0 ? await r.getElementRects({
404
+ }, v && p <= 50 && (p++, typeof v == "object" && (v.placement && (d = v.placement), v.rects && (a = v.rects === !0 ? await r.getElementRects({
393
405
  reference: t,
394
406
  floating: e,
395
407
  strategy: s
@@ -422,7 +434,7 @@ async function re(t, e) {
422
434
  elementContext: u = "floating",
423
435
  altBoundary: d = !1,
424
436
  padding: h = 0
425
- } = lt(e, t), m = _e(h), y = c[d ? u === "floating" ? "reference" : "floating" : u], p = rt(await i.getClippingRect({
437
+ } = lt(e, t), p = Ie(h), y = c[d ? u === "floating" ? "reference" : "floating" : u], m = rt(await i.getClippingRect({
426
438
  element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
427
439
  boundary: a,
428
440
  rootBoundary: f,
@@ -445,13 +457,13 @@ async function re(t, e) {
445
457
  strategy: l
446
458
  }) : w);
447
459
  return {
448
- top: (p.top - v.top + m.top) / b.y,
449
- bottom: (v.bottom - p.bottom + m.bottom) / b.y,
450
- left: (p.left - v.left + m.left) / b.x,
451
- right: (v.right - p.right + m.right) / b.x
460
+ top: (m.top - v.top + p.top) / b.y,
461
+ bottom: (v.bottom - m.bottom + p.bottom) / b.y,
462
+ left: (m.left - v.left + p.left) / b.x,
463
+ right: (v.right - m.right + p.right) / b.x
452
464
  };
453
465
  }
454
- const je = function(t) {
466
+ const Ye = function(t) {
455
467
  return t === void 0 && (t = {}), {
456
468
  name: "flip",
457
469
  options: t,
@@ -469,26 +481,26 @@ const je = function(t) {
469
481
  crossAxis: u = !0,
470
482
  fallbackPlacements: d,
471
483
  fallbackStrategy: h = "bestFit",
472
- fallbackAxisSideDirection: m = "none",
484
+ fallbackAxisSideDirection: p = "none",
473
485
  flipAlignment: g = !0,
474
486
  ...y
475
487
  } = lt(t, e);
476
488
  if ((n = i.arrow) != null && n.alignmentOffset)
477
489
  return {};
478
- const p = N(s), w = z(c), x = N(c) === c, b = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), v = d || (x || !g ? [it(c)] : Be(c)), B = m !== "none";
479
- !d && B && v.push(...He(c, g, m, b));
480
- const me = [c, ...v], mt = await re(e, y), Z = [];
490
+ const m = N(s), w = z(c), x = N(c) === c, b = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), v = d || (x || !g ? [it(c)] : Ue(c)), B = p !== "none";
491
+ !d && B && v.push(...ze(c, g, p, b));
492
+ const pe = [c, ...v], pt = await re(e, y), Z = [];
481
493
  let j = ((o = i.flip) == null ? void 0 : o.overflows) || [];
482
- if (f && Z.push(mt[p]), u) {
483
- const M = $e(s, r, b);
484
- Z.push(mt[M[0]], mt[M[1]]);
494
+ if (f && Z.push(pt[m]), u) {
495
+ const M = Be(s, r, b);
496
+ Z.push(pt[M[0]], pt[M[1]]);
485
497
  }
486
498
  if (j = [...j, {
487
499
  placement: s,
488
500
  overflows: Z
489
501
  }], !Z.every((M) => M <= 0)) {
490
502
  var St, kt;
491
- const M = (((St = i.flip) == null ? void 0 : St.index) || 0) + 1, Dt = me[M];
503
+ const M = (((St = i.flip) == null ? void 0 : St.index) || 0) + 1, Dt = pe[M];
492
504
  if (Dt)
493
505
  return {
494
506
  data: {
@@ -512,7 +524,7 @@ const je = function(t) {
512
524
  k === "y";
513
525
  }
514
526
  return !0;
515
- }).map((S) => [S.placement, S.overflows.filter((k) => k > 0).reduce((k, pe) => k + pe, 0)]).sort((S, k) => S[1] - k[1])[0]) == null ? void 0 : Ct[0];
527
+ }).map((S) => [S.placement, S.overflows.filter((k) => k > 0).reduce((k, me) => k + me, 0)]).sort((S, k) => S[1] - k[1])[0]) == null ? void 0 : Ct[0];
516
528
  U && (Y = U);
517
529
  break;
518
530
  }
@@ -531,7 +543,7 @@ const je = function(t) {
531
543
  }
532
544
  };
533
545
  };
534
- async function Ye(t, e) {
546
+ async function qe(t, e) {
535
547
  const {
536
548
  placement: n,
537
549
  platform: o,
@@ -540,7 +552,7 @@ async function Ye(t, e) {
540
552
  let {
541
553
  mainAxis: d,
542
554
  crossAxis: h,
543
- alignmentAxis: m
555
+ alignmentAxis: p
544
556
  } = typeof u == "number" ? {
545
557
  mainAxis: u,
546
558
  crossAxis: 0,
@@ -550,7 +562,7 @@ async function Ye(t, e) {
550
562
  crossAxis: u.crossAxis || 0,
551
563
  alignmentAxis: u.alignmentAxis
552
564
  };
553
- return c && typeof m == "number" && (h = c === "end" ? m * -1 : m), l ? {
565
+ return c && typeof p == "number" && (h = c === "end" ? p * -1 : p), l ? {
554
566
  x: h * f,
555
567
  y: d * a
556
568
  } : {
@@ -558,7 +570,7 @@ async function Ye(t, e) {
558
570
  y: h * f
559
571
  };
560
572
  }
561
- const qe = function(t) {
573
+ const Ke = function(t) {
562
574
  return t === void 0 && (t = 0), {
563
575
  name: "offset",
564
576
  options: t,
@@ -569,7 +581,7 @@ const qe = function(t) {
569
581
  y: i,
570
582
  placement: r,
571
583
  middlewareData: c
572
- } = e, l = await Ye(e, t);
584
+ } = e, l = await qe(e, t);
573
585
  return r === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
574
586
  x: s + l.x,
575
587
  y: i + l.y,
@@ -580,7 +592,7 @@ const qe = function(t) {
580
592
  };
581
593
  }
582
594
  };
583
- }, Ke = function(t) {
595
+ }, Xe = function(t) {
584
596
  return t === void 0 && (t = {}), {
585
597
  name: "shift",
586
598
  options: t,
@@ -595,11 +607,11 @@ const qe = function(t) {
595
607
  limiter: c = {
596
608
  fn: (y) => {
597
609
  let {
598
- x: p,
610
+ x: m,
599
611
  y: w
600
612
  } = y;
601
613
  return {
602
- x: p,
614
+ x: m,
603
615
  y: w
604
616
  };
605
617
  }
@@ -609,19 +621,19 @@ const qe = function(t) {
609
621
  x: n,
610
622
  y: o
611
623
  }, f = await re(e, l), u = z(N(s)), d = oe(u);
612
- let h = a[d], m = a[u];
624
+ let h = a[d], p = a[u];
613
625
  if (i) {
614
- const y = d === "y" ? "top" : "left", p = d === "y" ? "bottom" : "right", w = h + f[y], x = h - f[p];
626
+ const y = d === "y" ? "top" : "left", m = d === "y" ? "bottom" : "right", w = h + f[y], x = h - f[m];
615
627
  h = Wt(w, h, x);
616
628
  }
617
629
  if (r) {
618
- const y = u === "y" ? "top" : "left", p = u === "y" ? "bottom" : "right", w = m + f[y], x = m - f[p];
619
- m = Wt(w, m, x);
630
+ const y = u === "y" ? "top" : "left", m = u === "y" ? "bottom" : "right", w = p + f[y], x = p - f[m];
631
+ p = Wt(w, p, x);
620
632
  }
621
633
  const g = c.fn({
622
634
  ...e,
623
635
  [d]: h,
624
- [u]: m
636
+ [u]: p
625
637
  });
626
638
  return {
627
639
  ...g,
@@ -672,7 +684,7 @@ function Q(t) {
672
684
  } = E(t);
673
685
  return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(s);
674
686
  }
675
- function Xe(t) {
687
+ function Je(t) {
676
688
  return ["table", "td", "th"].includes(I(t));
677
689
  }
678
690
  function ft(t) {
@@ -688,7 +700,7 @@ function Et(t) {
688
700
  const e = Lt(), n = R(t) ? E(t) : t;
689
701
  return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
690
702
  }
691
- function Je(t) {
703
+ function Ge(t) {
692
704
  let e = P(t);
693
705
  for (; O(e) && !_(e); ) {
694
706
  if (Et(e))
@@ -774,15 +786,15 @@ function H(t) {
774
786
  y: c
775
787
  };
776
788
  }
777
- const Ge = /* @__PURE__ */ L(0);
789
+ const Qe = /* @__PURE__ */ L(0);
778
790
  function ue(t) {
779
791
  const e = A(t);
780
- return !Lt() || !e.visualViewport ? Ge : {
792
+ return !Lt() || !e.visualViewport ? Qe : {
781
793
  x: e.visualViewport.offsetLeft,
782
794
  y: e.visualViewport.offsetTop
783
795
  };
784
796
  }
785
- function Qe(t, e, n) {
797
+ function Ze(t, e, n) {
786
798
  return e === void 0 && (e = !1), !n || e && n !== A(t) ? !1 : e;
787
799
  }
788
800
  function $(t, e, n, o) {
@@ -790,14 +802,14 @@ function $(t, e, n, o) {
790
802
  const s = t.getBoundingClientRect(), i = Ot(t);
791
803
  let r = L(1);
792
804
  e && (o ? R(o) && (r = H(o)) : r = H(t));
793
- const c = Qe(i, n, o) ? ue(i) : L(0);
805
+ const c = Ze(i, n, o) ? ue(i) : L(0);
794
806
  let l = (s.left + c.x) / r.x, a = (s.top + c.y) / r.y, f = s.width / r.x, u = s.height / r.y;
795
807
  if (i) {
796
808
  const d = A(i), h = o && R(o) ? A(o) : o;
797
- let m = d, g = vt(m);
798
- for (; g && o && h !== m; ) {
799
- const y = H(g), p = g.getBoundingClientRect(), w = E(g), x = p.left + (g.clientLeft + parseFloat(w.paddingLeft)) * y.x, b = p.top + (g.clientTop + parseFloat(w.paddingTop)) * y.y;
800
- l *= y.x, a *= y.y, f *= y.x, u *= y.y, l += x, a += b, m = A(g), g = vt(m);
809
+ let p = d, g = vt(p);
810
+ for (; g && o && h !== p; ) {
811
+ const y = H(g), m = g.getBoundingClientRect(), w = E(g), x = m.left + (g.clientLeft + parseFloat(w.paddingLeft)) * y.x, b = m.top + (g.clientTop + parseFloat(w.paddingTop)) * y.y;
812
+ l *= y.x, a *= y.y, f *= y.x, u *= y.y, l += x, a += b, p = A(g), g = vt(p);
801
813
  }
802
814
  }
803
815
  return rt({
@@ -822,7 +834,7 @@ function fe(t, e, n) {
822
834
  y: i
823
835
  };
824
836
  }
825
- function Ze(t) {
837
+ function tn(t) {
826
838
  let {
827
839
  elements: e,
828
840
  rect: n,
@@ -849,10 +861,10 @@ function Ze(t) {
849
861
  y: n.y * a.y - l.scrollTop * a.y + f.y + d.y
850
862
  };
851
863
  }
852
- function tn(t) {
864
+ function en(t) {
853
865
  return Array.from(t.getClientRects());
854
866
  }
855
- function en(t) {
867
+ function nn(t) {
856
868
  const e = T(t), n = ht(t), o = t.ownerDocument.body, s = V(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = V(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
857
869
  let r = -n.scrollLeft + Tt(t);
858
870
  const c = -n.scrollTop;
@@ -863,7 +875,7 @@ function en(t) {
863
875
  y: c
864
876
  };
865
877
  }
866
- function nn(t, e) {
878
+ function on(t, e) {
867
879
  const n = A(t), o = T(t), s = n.visualViewport;
868
880
  let i = o.clientWidth, r = o.clientHeight, c = 0, l = 0;
869
881
  if (s) {
@@ -878,7 +890,7 @@ function nn(t, e) {
878
890
  y: l
879
891
  };
880
892
  }
881
- function on(t, e) {
893
+ function sn(t, e) {
882
894
  const n = $(t, !0, e === "fixed"), o = n.top + t.clientTop, s = n.left + t.clientLeft, i = O(t) ? H(t) : L(1), r = t.clientWidth * i.x, c = t.clientHeight * i.y, l = s * i.x, a = o * i.y;
883
895
  return {
884
896
  width: r,
@@ -890,11 +902,11 @@ function on(t, e) {
890
902
  function Vt(t, e, n) {
891
903
  let o;
892
904
  if (e === "viewport")
893
- o = nn(t, n);
905
+ o = on(t, n);
894
906
  else if (e === "document")
895
- o = en(T(t));
907
+ o = nn(T(t));
896
908
  else if (R(e))
897
- o = on(e, n);
909
+ o = sn(e, n);
898
910
  else {
899
911
  const s = ue(t);
900
912
  o = {
@@ -910,7 +922,7 @@ function he(t, e) {
910
922
  const n = P(t);
911
923
  return n === e || !R(n) || _(n) ? !1 : E(n).position === "fixed" || he(n, e);
912
924
  }
913
- function sn(t, e) {
925
+ function rn(t, e) {
914
926
  const n = e.get(t);
915
927
  if (n)
916
928
  return n;
@@ -923,14 +935,14 @@ function sn(t, e) {
923
935
  }
924
936
  return e.set(t, o), o;
925
937
  }
926
- function rn(t) {
938
+ function cn(t) {
927
939
  let {
928
940
  element: e,
929
941
  boundary: n,
930
942
  rootBoundary: o,
931
943
  strategy: s
932
944
  } = t;
933
- const r = [...n === "clippingAncestors" ? ft(e) ? [] : sn(e, this._c) : [].concat(n), o], c = r[0], l = r.reduce((a, f) => {
945
+ const r = [...n === "clippingAncestors" ? ft(e) ? [] : rn(e, this._c) : [].concat(n), o], c = r[0], l = r.reduce((a, f) => {
934
946
  const u = Vt(e, f, s);
935
947
  return a.top = V(u.top, a.top), a.right = ot(u.right, a.right), a.bottom = ot(u.bottom, a.bottom), a.left = V(u.left, a.left), a;
936
948
  }, Vt(e, c, s));
@@ -941,7 +953,7 @@ function rn(t) {
941
953
  y: l.top
942
954
  };
943
955
  }
944
- function cn(t) {
956
+ function ln(t) {
945
957
  const {
946
958
  width: e,
947
959
  height: n
@@ -951,7 +963,7 @@ function cn(t) {
951
963
  height: n
952
964
  };
953
965
  }
954
- function ln(t, e, n) {
966
+ function an(t, e, n) {
955
967
  const o = O(e), s = T(e), i = n === "fixed", r = $(t, !0, i, e);
956
968
  let c = {
957
969
  scrollLeft: 0,
@@ -996,14 +1008,14 @@ function de(t, e) {
996
1008
  return n;
997
1009
  }
998
1010
  let o = Nt(t, e);
999
- for (; o && Xe(o) && gt(o); )
1011
+ for (; o && Je(o) && gt(o); )
1000
1012
  o = Nt(o, e);
1001
- return o && _(o) && gt(o) && !Et(o) ? n : o || Je(t) || n;
1013
+ return o && _(o) && gt(o) && !Et(o) ? n : o || Ge(t) || n;
1002
1014
  }
1003
- const an = async function(t) {
1015
+ const un = async function(t) {
1004
1016
  const e = this.getOffsetParent || de, n = this.getDimensions, o = await n(t.floating);
1005
1017
  return {
1006
- reference: ln(t.reference, await e(t.floating), t.strategy),
1018
+ reference: an(t.reference, await e(t.floating), t.strategy),
1007
1019
  floating: {
1008
1020
  x: 0,
1009
1021
  y: 0,
@@ -1012,22 +1024,22 @@ const an = async function(t) {
1012
1024
  }
1013
1025
  };
1014
1026
  };
1015
- function un(t) {
1027
+ function fn(t) {
1016
1028
  return E(t).direction === "rtl";
1017
1029
  }
1018
- const fn = {
1019
- convertOffsetParentRelativeRectToViewportRelativeRect: Ze,
1030
+ const hn = {
1031
+ convertOffsetParentRelativeRectToViewportRelativeRect: tn,
1020
1032
  getDocumentElement: T,
1021
- getClippingRect: rn,
1033
+ getClippingRect: cn,
1022
1034
  getOffsetParent: de,
1023
- getElementRects: an,
1024
- getClientRects: tn,
1025
- getDimensions: cn,
1035
+ getElementRects: un,
1036
+ getClientRects: en,
1037
+ getDimensions: ln,
1026
1038
  getScale: H,
1027
1039
  isElement: R,
1028
- isRTL: un
1040
+ isRTL: fn
1029
1041
  };
1030
- function hn(t, e) {
1042
+ function dn(t, e) {
1031
1043
  let n = null, o;
1032
1044
  const s = T(t);
1033
1045
  function i() {
@@ -1044,8 +1056,8 @@ function hn(t, e) {
1044
1056
  } = t.getBoundingClientRect();
1045
1057
  if (c || e(), !u || !d)
1046
1058
  return;
1047
- const h = et(f), m = et(s.clientWidth - (a + u)), g = et(s.clientHeight - (f + d)), y = et(a), w = {
1048
- rootMargin: -h + "px " + -m + "px " + -g + "px " + -y + "px",
1059
+ const h = et(f), p = et(s.clientWidth - (a + u)), g = et(s.clientHeight - (f + d)), y = et(a), w = {
1060
+ rootMargin: -h + "px " + -p + "px " + -g + "px " + -y + "px",
1049
1061
  threshold: V(0, ot(1, l)) || 1
1050
1062
  };
1051
1063
  let x = !0;
@@ -1073,7 +1085,7 @@ function hn(t, e) {
1073
1085
  }
1074
1086
  return r(!0), i;
1075
1087
  }
1076
- function dn(t, e, n, o) {
1088
+ function pn(t, e, n, o) {
1077
1089
  o === void 0 && (o = {});
1078
1090
  const {
1079
1091
  ancestorScroll: s = !0,
@@ -1082,46 +1094,46 @@ function dn(t, e, n, o) {
1082
1094
  layoutShift: c = typeof IntersectionObserver == "function",
1083
1095
  animationFrame: l = !1
1084
1096
  } = o, a = Ot(t), f = s || i ? [...a ? K(a) : [], ...K(e)] : [];
1085
- f.forEach((p) => {
1086
- s && p.addEventListener("scroll", n, {
1097
+ f.forEach((m) => {
1098
+ s && m.addEventListener("scroll", n, {
1087
1099
  passive: !0
1088
- }), i && p.addEventListener("resize", n);
1100
+ }), i && m.addEventListener("resize", n);
1089
1101
  });
1090
- const u = a && c ? hn(a, n) : null;
1102
+ const u = a && c ? dn(a, n) : null;
1091
1103
  let d = -1, h = null;
1092
- r && (h = new ResizeObserver((p) => {
1093
- let [w] = p;
1104
+ r && (h = new ResizeObserver((m) => {
1105
+ let [w] = m;
1094
1106
  w && w.target === a && h && (h.unobserve(e), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
1095
1107
  var x;
1096
1108
  (x = h) == null || x.observe(e);
1097
1109
  })), n();
1098
1110
  }), a && !l && h.observe(a), h.observe(e));
1099
- let m, g = l ? $(t) : null;
1111
+ let p, g = l ? $(t) : null;
1100
1112
  l && y();
1101
1113
  function y() {
1102
- const p = $(t);
1103
- g && (p.x !== g.x || p.y !== g.y || p.width !== g.width || p.height !== g.height) && n(), g = p, m = requestAnimationFrame(y);
1114
+ const m = $(t);
1115
+ g && (m.x !== g.x || m.y !== g.y || m.width !== g.width || m.height !== g.height) && n(), g = m, p = requestAnimationFrame(y);
1104
1116
  }
1105
1117
  return n(), () => {
1106
- var p;
1118
+ var m;
1107
1119
  f.forEach((w) => {
1108
1120
  s && w.removeEventListener("scroll", n), i && w.removeEventListener("resize", n);
1109
- }), u == null || u(), (p = h) == null || p.disconnect(), h = null, l && cancelAnimationFrame(m);
1121
+ }), u == null || u(), (m = h) == null || m.disconnect(), h = null, l && cancelAnimationFrame(p);
1110
1122
  };
1111
1123
  }
1112
- const mn = qe, pn = Ke, $t = je, gn = (t, e, n) => {
1124
+ const mn = Ke, gn = Xe, $t = Ye, yn = (t, e, n) => {
1113
1125
  const o = /* @__PURE__ */ new Map(), s = {
1114
- platform: fn,
1126
+ platform: hn,
1115
1127
  ...n
1116
1128
  }, i = {
1117
1129
  ...s.platform,
1118
1130
  _c: o
1119
1131
  };
1120
- return Ie(t, e, {
1132
+ return je(t, e, {
1121
1133
  ...s,
1122
1134
  platform: i
1123
1135
  });
1124
- }, Un = ({
1136
+ }, Hn = ({
1125
1137
  content: t,
1126
1138
  open: e,
1127
1139
  placement: n,
@@ -1136,14 +1148,14 @@ const mn = qe, pn = Ke, $t = je, gn = (t, e, n) => {
1136
1148
  G((l) => {
1137
1149
  const a = l;
1138
1150
  return a.style.position = "absolute", F(
1139
- dn(c, a, async () => {
1140
- const { x: f, y: u } = await gn(c, a, {
1151
+ pn(c, a, async () => {
1152
+ const { x: f, y: u } = await yn(c, a, {
1141
1153
  placement: n,
1142
1154
  strategy: "absolute",
1143
1155
  middleware: [
1144
1156
  $t(),
1145
1157
  mn({ mainAxis: o, crossAxis: s }),
1146
- pn(),
1158
+ gn(),
1147
1159
  $t()
1148
1160
  ]
1149
1161
  });
@@ -1155,7 +1167,7 @@ const mn = qe, pn = Ke, $t = je, gn = (t, e, n) => {
1155
1167
  )
1156
1168
  )
1157
1169
  );
1158
- }), yn = (t, e, n) => {
1170
+ }), wn = (t, e, n) => {
1159
1171
  const o = W(C.notAsked), s = o.map(
1160
1172
  (u) => C.isSuccess(u) ? u.value : void 0
1161
1173
  ), i = o.map(
@@ -1167,10 +1179,10 @@ const mn = qe, pn = Ke, $t = je, gn = (t, e, n) => {
1167
1179
  const d = c.signal, h = o.get();
1168
1180
  o.set(C.loading(C.getOrUndefined(h)));
1169
1181
  try {
1170
- const m = await e({ request: u, abortSignal: d, previous: h });
1171
- await Promise.resolve(), c = void 0, o.set(C.success(m));
1172
- } catch (m) {
1173
- c = void 0, o.set(C.failure(n(m)));
1182
+ const p = await e({ request: u, abortSignal: d, previous: h });
1183
+ await Promise.resolve(), c = void 0, o.set(C.success(p));
1184
+ } catch (p) {
1185
+ c = void 0, o.set(C.failure(n(p)));
1174
1186
  }
1175
1187
  }, a = () => l(D.get(t)), f = () => {
1176
1188
  c == null || c.abort(), c = void 0, o.dispose();
@@ -1183,7 +1195,7 @@ const mn = qe, pn = Ke, $t = je, gn = (t, e, n) => {
1183
1195
  reload: a,
1184
1196
  dispose: f
1185
1197
  };
1186
- }, wn = (t, e) => {
1198
+ }, xn = (t, e) => {
1187
1199
  const { status: n, dispose: o, reload: s } = t, { loading: i, failure: r, success: c } = e;
1188
1200
  return At(
1189
1201
  F(o),
@@ -1193,16 +1205,16 @@ const mn = qe, pn = Ke, $t = je, gn = (t, e, n) => {
1193
1205
  success: (l) => c(l, s)
1194
1206
  })
1195
1207
  );
1196
- }, Hn = ({
1208
+ }, zn = ({
1197
1209
  request: t,
1198
1210
  load: e,
1199
1211
  mapError: n = (o) => o
1200
1212
  }) => {
1201
- const o = yn(t, e, n);
1202
- return (s) => wn(o, s);
1203
- }, xn = (t, e) => {
1213
+ const o = wn(t, e, n);
1214
+ return (s) => xn(o, s);
1215
+ }, vn = (t, e) => {
1204
1216
  if (typeof e == "function")
1205
- return xn(t, { success: e });
1217
+ return vn(t, { success: e });
1206
1218
  const n = e.failure ?? ((s) => At(
1207
1219
  F(s.on(console.error)),
1208
1220
  s.map((i) => `Error: ${i}`)
@@ -1211,7 +1223,7 @@ const mn = qe, pn = Ke, $t = je, gn = (t, e, n) => {
1211
1223
  Success: (s) => o(s.$.value),
1212
1224
  Failure: (s) => n(s.$.error)
1213
1225
  });
1214
- }, zn = () => qt.focus((t) => {
1226
+ }, _n = () => qt.focus((t) => {
1215
1227
  var e;
1216
1228
  return (e = t.target) == null ? void 0 : e.select();
1217
1229
  });
@@ -1254,7 +1266,7 @@ class dt {
1254
1266
  * console.log(rect1.equals(rect3)); // true (within tolerance)
1255
1267
  * ```
1256
1268
  */
1257
- pt(this, "equals", (e) => tt(this.left, e.left) && tt(this.top, e.top) && tt(this.width, e.width) && tt(this.height, e.height));
1269
+ mt(this, "equals", (e) => tt(this.left, e.left) && tt(this.top, e.top) && tt(this.width, e.width) && tt(this.height, e.height));
1258
1270
  this.left = e, this.top = n, this.width = o, this.height = s;
1259
1271
  }
1260
1272
  /**
@@ -1363,7 +1375,7 @@ function Bt(t) {
1363
1375
  height: e.height
1364
1376
  });
1365
1377
  }
1366
- const vn = (t) => Qt((e) => {
1378
+ const bn = (t) => Qt((e) => {
1367
1379
  const { element: n } = e, o = W(Bt(n)), s = Rt(t(o))(e), i = () => {
1368
1380
  o.set(dt.of(Bt(n)));
1369
1381
  };
@@ -1371,7 +1383,7 @@ const vn = (t) => Qt((e) => {
1371
1383
  return typeof ResizeObserver == "function" && (r = new ResizeObserver(i), r.observe(n)), F((c) => {
1372
1384
  r == null || r.disconnect(), s(c);
1373
1385
  });
1374
- }), _n = (t) => vn(t), In = (t) => (e) => {
1386
+ }), In = (t) => bn(t), jn = (t) => (e) => {
1375
1387
  const n = J(), o = W({
1376
1388
  width: (n == null ? void 0 : n.innerWidth) ?? 0,
1377
1389
  height: (n == null ? void 0 : n.innerHeight) ?? 0
@@ -1384,7 +1396,7 @@ const vn = (t) => Qt((e) => {
1384
1396
  return n == null || n.addEventListener("resize", i), (r) => {
1385
1397
  n == null || n.removeEventListener("resize", i), s(r);
1386
1398
  };
1387
- }, bn = (t, e) => {
1399
+ }, An = (t, e) => {
1388
1400
  const n = e.split("/").filter((s) => s !== ""), o = {};
1389
1401
  for (let s = 0; s < t.length; s++) {
1390
1402
  const i = t[s], r = n[s];
@@ -1399,21 +1411,21 @@ const vn = (t) => Qt((e) => {
1399
1411
  return { params: o, path: e };
1400
1412
  }
1401
1413
  return n.length !== t.length ? null : { params: o, path: e };
1402
- }, An = (t) => t.split("/").map((e) => e.startsWith(":") ? { type: "param", name: e.slice(1) } : e === "*" ? { type: "catch-all" } : { type: "literal", value: e }).filter((e) => e.type !== "literal" || e.value !== ""), Rn = (t) => {
1414
+ }, Rn = (t) => t.split("/").map((e) => e.startsWith(":") ? { type: "param", name: e.slice(1) } : e === "*" ? { type: "catch-all" } : { type: "literal", value: e }).filter((e) => e.type !== "literal" || e.value !== ""), En = (t) => {
1403
1415
  const e = t.map((n) => {
1404
- const o = An(n);
1416
+ const o = Rn(n);
1405
1417
  return { route: n, segments: o };
1406
1418
  });
1407
1419
  return function(o) {
1408
1420
  for (const { segments: s, route: i } of e) {
1409
- const r = bn(s, o);
1421
+ const r = An(s, o);
1410
1422
  if (r)
1411
1423
  return { ...r, route: i };
1412
1424
  }
1413
1425
  return null;
1414
1426
  };
1415
- }, jn = (t) => {
1416
- const e = Rn(Object.keys(t));
1427
+ }, Yn = (t) => {
1428
+ const e = En(Object.keys(t));
1417
1429
  return jt(ee, (n) => {
1418
1430
  const o = n.map((s) => {
1419
1431
  const i = e(s.pathname);
@@ -1433,7 +1445,7 @@ const vn = (t) => Qt((e) => {
1433
1445
  t
1434
1446
  );
1435
1447
  });
1436
- }, ct = 60 * 1e3, bt = 60 * ct, X = 24 * bt, Ut = 7 * X, Ht = 30 * X, En = 365 * X, Ln = [
1448
+ }, ct = 60 * 1e3, bt = 60 * ct, X = 24 * bt, Ut = 7 * X, Ht = 30 * X, Ln = 365 * X, On = [
1437
1449
  {
1438
1450
  max: ct * 90,
1439
1451
  value: ct,
@@ -1471,7 +1483,7 @@ const vn = (t) => Qt((e) => {
1471
1483
  },
1472
1484
  {
1473
1485
  max: 1 / 0,
1474
- value: En,
1486
+ value: Ln,
1475
1487
  name: "year",
1476
1488
  past: { singular: "last year", plural: "{} years ago" },
1477
1489
  future: { singular: "in a year", plural: "in {} years" }
@@ -1487,76 +1499,77 @@ function zt(t, e, n, o) {
1487
1499
  })
1488
1500
  );
1489
1501
  }
1490
- const On = (t = 1e3) => {
1502
+ const Tn = (t = 1e3) => {
1491
1503
  const e = W(/* @__PURE__ */ new Date()), n = be(() => e.set(/* @__PURE__ */ new Date()), t);
1492
1504
  return e.onDispose(n), e;
1493
- }, Tn = (t) => {
1505
+ }, Sn = (t) => {
1494
1506
  const e = Math.abs(t);
1495
1507
  if (e < ct)
1496
1508
  return t < 0 ? "just now" : "in a moment";
1497
- for (const n of Ln)
1509
+ for (const n of On)
1498
1510
  if (e < n.max)
1499
1511
  return t < 0 ? zt(e, n.value, n.past.singular, n.past.plural) : zt(e, n.value, n.future.singular, n.future.plural);
1500
1512
  throw new Error("unreachable");
1501
- }, Sn = (t, { now: e, frequency: n = 1e4 } = {}) => {
1502
- const o = e != null ? It.is(e) ? e.derive() : W(e) : On(n), s = xe(
1513
+ }, kn = (t, { now: e, frequency: n = 1e4 } = {}) => {
1514
+ const o = e != null ? It.is(e) ? e.derive() : W(e) : Tn(n), s = xe(
1503
1515
  t,
1504
1516
  o
1505
1517
  )((i, r) => i.getTime() - r.getTime());
1506
1518
  return s.onDispose(() => D.dispose(o)), s;
1507
- }, kn = (t, e = {}) => {
1508
- const n = Sn(t, e), o = n.map(Tn);
1519
+ }, Cn = (t, e = {}) => {
1520
+ const n = kn(t, e), o = n.map(Sn);
1509
1521
  return o.onDispose(n.dispose), o;
1510
- }, Yn = (t, e = {}) => kn(t, e);
1511
- class Cn extends ve {
1522
+ }, qn = (t, e = {}) => Cn(t, e);
1523
+ class Dn extends ve {
1512
1524
  constructor() {
1513
1525
  super(...arguments);
1514
1526
  /**
1515
1527
  * Triggers an update of the Ticker by incrementing its internal value.
1516
1528
  * @returns void
1517
1529
  */
1518
- pt(this, "tick", () => this.update((n) => n + 1));
1530
+ mt(this, "tick", () => this.update((n) => n + 1));
1519
1531
  }
1520
1532
  }
1521
- const qn = (t = 0) => new Cn(t, (e, n) => e === n);
1533
+ const Kn = (t = 0) => new Dn(t, (e, n) => e === n);
1522
1534
  export {
1523
1535
  Pe as Anchor,
1524
- Fn as Appearance,
1536
+ Mn as Appearance,
1525
1537
  ne as AsyncResultView,
1526
- Mn as AutoFocus,
1527
- Vn as AutoSelect,
1528
- vn as ElementRect,
1529
- _n as ElementSize,
1530
- $n as HTMLTitle,
1531
- Nn as HiddenWhenEmpty,
1532
- Me as InViewport,
1538
+ Vn as AutoFocus,
1539
+ Nn as AutoSelect,
1540
+ bn as ElementRect,
1541
+ In as ElementSize,
1542
+ Bn as HTMLTitle,
1543
+ $n as HiddenWhenEmpty,
1544
+ Ve as InViewport,
1533
1545
  ee as Location,
1534
- Un as PopOver,
1546
+ Hn as PopOver,
1535
1547
  dt as Rect,
1536
- Hn as Resource,
1537
- wn as ResourceDisplay,
1538
- xn as ResultView,
1539
- jn as Router,
1540
- zn as SelectOnFocus,
1541
- Cn as Ticker,
1542
- Bn as WhenInViewport,
1543
- In as WindowSize,
1548
+ zn as Resource,
1549
+ xn as ResourceDisplay,
1550
+ vn as ResultView,
1551
+ Yn as Router,
1552
+ _n as SelectOnFocus,
1553
+ Dn as Ticker,
1554
+ Un as WhenInViewport,
1555
+ jn as WindowSize,
1544
1556
  Re as _checkExtensionCondition,
1545
1557
  Ae as _getExtension,
1546
- Rn as _makeRouteMatcher,
1547
- An as _parseRouteSegments,
1558
+ En as _makeRouteMatcher,
1559
+ Rn as _parseRouteSegments,
1548
1560
  Oe as areLocationsEqual,
1549
1561
  Bt as getAbsoluteRect,
1550
1562
  Le as handleAnchorClick,
1551
1563
  te as locationFromURL,
1552
- yn as makeResource,
1553
- bn as matchesRoute,
1554
- On as nowSignal,
1555
- Yn as relativeTime,
1556
- Sn as relativeTimeMillisSignal,
1557
- kn as relativeTimeSignal,
1564
+ wn as makeResource,
1565
+ An as matchesRoute,
1566
+ Tn as nowSignal,
1567
+ qn as relativeTime,
1568
+ kn as relativeTimeMillisSignal,
1569
+ Cn as relativeTimeSignal,
1558
1570
  Pt as setLocationFromUrl,
1559
- qn as ticker,
1560
- Tn as timeDiffToString,
1561
- wt as urlFromLocation
1571
+ Kn as ticker,
1572
+ Sn as timeDiffToString,
1573
+ wt as urlFromLocation,
1574
+ We as useAppearence
1562
1575
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/ui",
3
- "version": "2.10.0",
3
+ "version": "3.1.0",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -18,3 +18,14 @@ export type AppearanceType = 'light' | 'dark';
18
18
  * @public
19
19
  */
20
20
  export declare const Appearance: Provider<Signal<AppearanceType>>;
21
+ /**
22
+ * Creates a signal that represents the current appearance (light or dark) based on the user's system
23
+ * preferences.
24
+ *
25
+ * The appearance is updated whenever the user's system preferences change, and the signal is cleaned
26
+ * up when it is no longer needed.
27
+ *
28
+ * @returns A signal representing the current appearance.
29
+ * @public
30
+ */
31
+ export declare function useAppearence(): Signal<AppearanceType>;
@@ -8,23 +8,27 @@ import { Signal, TNode, Renderable } from '@tempots/dom';
8
8
  * @public
9
9
  */
10
10
  export type InViewportMode = 'partial' | 'full';
11
+ export type InViewportOptions = {
12
+ mode?: InViewportMode;
13
+ once?: boolean;
14
+ };
11
15
  /**
12
16
  * Creates a renderable component that tracks whether the element is in the viewport.
13
17
  *
14
- * @param mode - The mode for tracking the element's visibility in the viewport.
18
+ * @param options - The options for the `InViewport` component.
15
19
  * @param fn - A function that returns the renderable component based on the visibility signal.
16
20
  * @returns The renderable component that tracks the element's visibility in the viewport.
17
21
  * @public
18
22
  */
19
- export declare const InViewport: (mode: InViewportMode, fn: (value: Signal<boolean>) => TNode) => Renderable;
23
+ export declare const InViewport: ({ mode, once }: InViewportOptions, fn: (value: Signal<boolean>) => TNode) => Renderable;
20
24
  /**
21
25
  * Executes the provided `then` function when the element is in the viewport.
22
26
  * Optionally, executes the `otherwise` function when the element is not in the viewport.
23
27
  *
24
- * @param mode - The mode to determine when the element is considered in the viewport.
28
+ * @param options - The options for the `InViewport` component.
25
29
  * @param then - The function to execute when the element is in the viewport.
26
30
  * @param otherwise - The function to execute when the element is not in the viewport.
27
31
  * @returns The result of executing the `then` function or the `otherwise` function.
28
32
  * @public
29
33
  */
30
- export declare const WhenInViewport: (mode: InViewportMode, then: () => TNode, otherwise?: () => TNode) => Renderable;
34
+ export declare const WhenInViewport: (options: InViewportOptions, then: () => TNode, otherwise?: () => TNode) => Renderable;