@tempots/ui 0.23.0-next.16 → 0.23.0-next.17

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/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tempots/dom"),Ct=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const n=e.split(".")||[];return n.length>1?"."+n.pop():void 0},Ft=(t,e)=>{const n=Ct(e);return n!=null&&(t.length===0||!t.some(o=>n==o))},re=(t,e,n,o)=>{let r=t.target;for(;r!=null&&!(r instanceof HTMLAnchorElement);)r=r.parentElement;if(r==null)return!0;const i=r;if(t.button!==0||t.ctrlKey||t.metaKey||i.target!=="_self"&&i.target!==""||i.getAttribute("download")!=null)return!0;const{pathname:s,search:c,hash:a}=i;if(o){const l=s+c+a,m=i.getAttribute("href");if(!(m!=null&&m.startsWith("#"))&&m!==l)return!0}return e?!1:Ft(n,s)},Wt=(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=>{re(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},Dt=u.makeProviderMark("LocationProvider"),ie=t=>u.Fragment(u.OnBrowserCtx(e=>u.Async(Promise.resolve().then(()=>require("./browser-location-D36kVbd7.cjs")).then(n=>n.ProvideBrowserLocation),n=>n(t))(e)),u.OnHeadlessCtx(e=>u.Async(Promise.resolve().then(()=>require("./headless-location-8Va85S-Q.cjs")).then(n=>n.ProvideHeadlessLocation),n=>n(e.container.currentURL,t))(e))),mt=t=>u.UseProvider(Dt,e=>n=>{const o=u.makeProp(e.value,e.equals);e.feedProp(o),o.on(e.set);const r=u.renderableOfTNode(t(o))(n);return i=>{o.dispose(),r(i)}}),se=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,Mt=(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 r=n.hash;return r.startsWith("#")&&(r=r.substring(1)),{pathname:n.pathname,search:o,hash:r===""?void 0:r}},Vt=(t,e)=>{const n=Mt(e);return t.set(n),t},ce=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},Nt=(t,...e)=>{if(typeof t=="string"||u.Signal.is(t))return Nt({href:t},...e);const{href:n,...o}=t;return mt(r=>u.html.a(u.on.click(Wt(()=>(Vt(r,u.Value.get(n)),!0),o)),u.attr.href(n),...e))},ht=u.makeProviderMark("Appearance"),le=t=>{const e=u.getWindow(),n=e!=null&&e.matchMedia!=null&&e.matchMedia("(prefers-color-scheme: dark)").matches,o=u.makeProp(n?"dark":"light"),r=s=>{o.set(s.matches?"dark":"light")},i=e!=null&&e.matchMedia!=null?e.matchMedia("(prefers-color-scheme: dark)"):void 0;return i==null||i.addEventListener("change",r),u.Fragment(u.WithProvider(ht,o,t),u.OnDispose(()=>i==null?void 0:i.removeEventListener("change",r)))},ae=t=>u.UseProvider(ht,t),Ht=(t,e)=>{if(typeof e=="function")return Ht(t,{success:e});const n=e.failure??(s=>u.Fragment(u.OnDispose(s.on(console.error)),s.map(c=>`Error: ${c}`))),o=e.success,r=e.loading??(()=>u.Empty),i=e.notAsked??(()=>u.Empty);return u.OneOfType(u.Value.toSignal(t),{AsyncSuccess:s=>o(s.$.value),AsyncFailure:s=>n(s.$.error),Loading:s=>r(s.$.previousValue??u.makeSignal(void 0)),NotAsked:i})},ue=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.focus()},t);return()=>clearTimeout(n)}),fe=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.select()},t);return()=>clearTimeout(n)}),me=u.OnElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),n=>{n&&t.style.setProperty(":empty",e)}}),he=t=>u.Portal("head > title",u.attr.innerText(t)),de={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},J={partial:new Map,full:new Map},I={partial:null,full:null};function pe(t){return I[t]==null&&(I[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=J[t].get(n.target);o==null||o.set(n.isIntersecting)})},de[t])),I[t]}const $t=(t,e)=>{const n=u.makeProp(!1);return u.Fragment(u.OnElement(o=>{const r=typeof IntersectionObserver<"u"?pe(t):null;return J[t].set(o,n),r==null||r.observe(o),()=>{var i;n.dispose(),r==null||r.unobserve(o),J[t].delete(o),J[t].size===0&&((i=I[t])==null||i.disconnect(),I[t]=null)}}),u.renderableOfTNode(e(n)))},ge=(t,e,n)=>$t(t,o=>u.When(o,e,n??u.Empty)),G=Math.min,W=Math.max,Q=Math.round,X=Math.floor,L=t=>({x:t,y:t}),ye={left:"right",right:"left",bottom:"top",top:"bottom"},we={start:"end",end:"start"};function At(t,e,n){return W(t,G(e,n))}function nt(t,e){return typeof t=="function"?t(e):t}function D(t){return t.split("-")[0]}function ot(t){return t.split("-")[1]}function zt(t){return t==="x"?"y":"x"}function Bt(t){return t==="y"?"height":"width"}function $(t){return["top","bottom"].includes(D(t))?"y":"x"}function Ut(t){return zt($(t))}function xe(t,e,n){n===void 0&&(n=!1);const o=ot(t),r=Ut(t),i=Bt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Z(s)),[s,Z(s)]}function ve(t){const e=Z(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>we[e])}function be(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:s;default:return[]}}function Ae(t,e,n,o){const r=ot(t);let i=be(D(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(at)))),i}function Z(t){return t.replace(/left|right|bottom|top/g,e=>ye[e])}function Ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Oe(t){return typeof t!="number"?Ee(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:r}=t;const i=$(e),s=Ut(e),c=Bt(s),a=D(e),l=i==="y",m=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let h;switch(a){case"top":h={x:m,y:o.y-r.height};break;case"bottom":h={x:m,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}switch(ot(e)){case"start":h[s]-=d*(n&&l?-1:1);break;case"end":h[s]+=d*(n&&l?-1:1);break}return h}const Re=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:m,y:f}=Et(l,o,a),d=o,h={},g=0;for(let y=0;y<c.length;y++){const{name:w,fn:p}=c[y],{x,y:v,data:A,reset:b}=await p({x:m,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});m=x??m,f=v??f,h={...h,[w]:{...h[w],...A}},b&&g<=50&&(g++,typeof b=="object"&&(b.placement&&(d=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):b.rects),{x:m,y:f}=Et(l,d,a)),y=-1)}return{x:m,y:f,placement:d,strategy:r,middlewareData:h}};async function _t(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=nt(e,t),g=Oe(h),w=c[d?f==="floating"?"reference":"floating":f],p=tt(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:l,rootBoundary:m,strategy:a})),x=f==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.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=tt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:a}):x);return{top:(p.top-b.top+g.top)/A.y,bottom:(b.bottom-p.bottom+g.bottom)/A.y,left:(p.left-b.left+g.left)/A.x,right:(b.right-p.right+g.right)/A.x}}const Le=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:a,elements:l}=e,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=nt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const p=D(r),x=$(c),v=D(c)===c,A=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=d||(v||!y?[Z(c)]:ve(c)),V=g!=="none";!d&&V&&b.push(...Ae(c,y,g,A));const ne=[c,...b],ct=await _t(e,w),K=[];let U=((o=i.flip)==null?void 0:o.overflows)||[];if(m&&K.push(ct[p]),f){const F=xe(r,s,A);K.push(ct[F[0]],ct[F[1]])}if(U=[...U,{placement:r,overflows:K}],!K.every(F=>F<=0)){var wt,xt;const F=(((wt=i.flip)==null?void 0:wt.index)||0)+1,bt=ne[F];if(bt)return{data:{index:F,overflows:U},reset:{placement:bt}};let _=(xt=U.filter(N=>N.overflows[0]<=0).sort((N,S)=>N.overflows[1]-S.overflows[1])[0])==null?void 0:xt.placement;if(!_)switch(h){case"bestFit":{var vt;const N=(vt=U.filter(S=>{if(V){const P=$(S.placement);return P===x||P==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(P=>P>0).reduce((P,oe)=>P+oe,0)]).sort((S,P)=>S[1]-P[1])[0])==null?void 0:vt[0];N&&(_=N);break}case"initialPlacement":_=c;break}if(r!==_)return{reset:{placement:_}}}return{}}}};async function Te(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=D(n),c=ot(n),a=$(n)==="y",l=["left","top"].includes(s)?-1:1,m=i&&a?-1:1,f=nt(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),a?{x:h*m,y:d*l}:{x:d*l,y:h*m}}const ke=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=e,a=await Te(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:s}}}}},Se=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:p,y:x}=w;return{x:p,y:x}}},...a}=nt(t,e),l={x:n,y:o},m=await _t(e,a),f=$(D(r)),d=zt(f);let h=l[d],g=l[f];if(i){const w=d==="y"?"top":"left",p=d==="y"?"bottom":"right",x=h+m[w],v=h-m[p];h=At(x,h,v)}if(s){const w=f==="y"?"top":"left",p=f==="y"?"bottom":"right",x=g+m[w],v=g-m[p];g=At(x,g,v)}const y=c.fn({...e,[d]:h,[f]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[d]:i,[f]:s}}}}}};function rt(){return typeof window<"u"}function B(t){return It(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=(It(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function It(t){return rt()?t instanceof Node||t instanceof E(t).Node:!1}function O(t){return rt()?t instanceof Element||t instanceof E(t).Element:!1}function T(t){return rt()?t instanceof HTMLElement||t instanceof E(t).HTMLElement:!1}function Ot(t){return!rt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function Y(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=R(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function Pe(t){return["table","td","th"].includes(B(t))}function it(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function dt(t){const e=pt(),n=O(t)?R(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 Ce(t){let e=C(t);for(;T(e)&&!z(e);){if(dt(e))return e;if(it(e))return null;e=C(e)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(B(t))}function R(t){return E(t).getComputedStyle(t)}function st(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function C(t){if(B(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ot(t)&&t.host||k(t);return Ot(e)?e.host:e}function jt(t){const e=C(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:T(e)&&Y(e)?e:jt(e)}function j(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=jt(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=E(r);if(i){const c=ut(s);return e.concat(s,s.visualViewport||[],Y(r)?r:[],c&&n?j(c):[])}return e.concat(r,j(r,[],n))}function ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function qt(t){const e=R(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=T(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,c=Q(n)!==i||Q(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function gt(t){return O(t)?t:t.contextElement}function H(t){const e=gt(t);if(!T(e))return L(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=qt(e);let s=(i?Q(n.width):n.width)/o,c=(i?Q(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Fe=L(0);function Yt(t){const e=E(t);return!pt()||!e.visualViewport?Fe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function We(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 r=t.getBoundingClientRect(),i=gt(t);let s=L(1);e&&(o?O(o)&&(s=H(o)):s=H(t));const c=We(i,n,o)?Yt(i):L(0);let a=(r.left+c.x)/s.x,l=(r.top+c.y)/s.y,m=r.width/s.x,f=r.height/s.y;if(i){const d=E(i),h=o&&O(o)?E(o):o;let g=d,y=ut(g);for(;y&&o&&h!==g;){const w=H(y),p=y.getBoundingClientRect(),x=R(y),v=p.left+(y.clientLeft+parseFloat(x.paddingLeft))*w.x,A=p.top+(y.clientTop+parseFloat(x.paddingTop))*w.y;a*=w.x,l*=w.y,m*=w.x,f*=w.y,a+=v,l+=A,g=E(y),y=ut(g)}}return tt({width:m,height:f,x:a,y:l})}function yt(t,e){const n=st(t).scrollLeft;return e?e.left+n:M(k(t)).left+n}function Kt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:yt(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function De(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=k(o),c=e?it(e.floating):!1;if(o===s||c&&i)return n;let a={scrollLeft:0,scrollTop:0},l=L(1);const m=L(0),f=T(o);if((f||!f&&!i)&&((B(o)!=="body"||Y(s))&&(a=st(o)),T(o))){const h=M(o);l=H(o),m.x=h.x+o.clientLeft,m.y=h.y+o.clientTop}const d=s&&!f&&!i?Kt(s,a,!0):L(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+m.x+d.x,y:n.y*l.y-a.scrollTop*l.y+m.y+d.y}}function Me(t){return Array.from(t.getClientRects())}function Ve(t){const e=k(t),n=st(t),o=t.ownerDocument.body,r=W(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=W(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+yt(t);const c=-n.scrollTop;return R(o).direction==="rtl"&&(s+=W(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}function Ne(t,e){const n=E(t),o=k(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,a=0;if(r){i=r.width,s=r.height;const l=pt();(!l||l&&e==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:s,x:c,y:a}}function He(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=T(t)?H(t):L(1),s=t.clientWidth*i.x,c=t.clientHeight*i.y,a=r*i.x,l=o*i.y;return{width:s,height:c,x:a,y:l}}function Rt(t,e,n){let o;if(e==="viewport")o=Ne(t,n);else if(e==="document")o=Ve(k(t));else if(O(e))o=He(e,n);else{const r=Yt(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return tt(o)}function Xt(t,e){const n=C(t);return n===e||!O(n)||z(n)?!1:R(n).position==="fixed"||Xt(n,e)}function $e(t,e){const n=e.get(t);if(n)return n;let o=j(t,[],!1).filter(c=>O(c)&&B(c)!=="body"),r=null;const i=R(t).position==="fixed";let s=i?C(t):t;for(;O(s)&&!z(s);){const c=R(s),a=dt(s);!a&&c.position==="fixed"&&(r=null),(i?!a&&!r:!a&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Y(s)&&!a&&Xt(t,s))?o=o.filter(m=>m!==s):r=c,s=C(s)}return e.set(t,o),o}function ze(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?it(e)?[]:$e(e,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,m)=>{const f=Rt(e,m,r);return l.top=W(f.top,l.top),l.right=G(f.right,l.right),l.bottom=G(f.bottom,l.bottom),l.left=W(f.left,l.left),l},Rt(e,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Be(t){const{width:e,height:n}=qt(t);return{width:e,height:n}}function Ue(t,e,n){const o=T(e),r=k(e),i=n==="fixed",s=M(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const a=L(0);if(o||!o&&!i)if((B(e)!=="body"||Y(r))&&(c=st(e)),o){const d=M(e,!0,i,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop}else r&&(a.x=yt(r));const l=r&&!o&&!i?Kt(r,c):L(0),m=s.left+c.scrollLeft-a.x-l.x,f=s.top+c.scrollTop-a.y-l.y;return{x:m,y:f,width:s.width,height:s.height}}function lt(t){return R(t).position==="static"}function Lt(t,e){if(!T(t)||R(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return k(t)===n&&(n=n.ownerDocument.body),n}function Jt(t,e){const n=E(t);if(it(t))return n;if(!T(t)){let r=C(t);for(;r&&!z(r);){if(O(r)&&!lt(r))return r;r=C(r)}return n}let o=Lt(t,e);for(;o&&Pe(o)&&lt(o);)o=Lt(o,e);return o&&z(o)&&lt(o)&&!dt(o)?n:o||Ce(t)||n}const _e=async function(t){const e=this.getOffsetParent||Jt,n=this.getDimensions,o=await n(t.floating);return{reference:Ue(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ie(t){return R(t).direction==="rtl"}const je={convertOffsetParentRelativeRectToViewportRelativeRect:De,getDocumentElement:k,getClippingRect:ze,getOffsetParent:Jt,getElementRects:_e,getClientRects:Me,getDimensions:Be,getScale:H,isElement:O,isRTL:Ie};function qe(t,e){let n=null,o;const r=k(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),i();const{left:l,top:m,width:f,height:d}=t.getBoundingClientRect();if(c||e(),!f||!d)return;const h=X(m),g=X(r.clientWidth-(l+f)),y=X(r.clientHeight-(m+d)),w=X(l),x={rootMargin:-h+"px "+-g+"px "+-y+"px "+-w+"px",threshold:W(0,G(1,a))||1};let v=!0;function A(b){const V=b[0].intersectionRatio;if(V!==a){if(!v)return s();V?s(!1,V):o=setTimeout(()=>{s(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(A,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(t)}return s(!0),i}function Ye(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=gt(t),m=r||i?[...l?j(l):[],...j(e)]:[];m.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),i&&p.addEventListener("resize",n)});const f=l&&c?qe(l,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(p=>{let[x]=p;x&&x.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(e)})),n()}),l&&!a&&h.observe(l),h.observe(e));let g,y=a?M(t):null;a&&w();function w(){const p=M(t);y&&(p.x!==y.x||p.y!==y.y||p.width!==y.width||p.height!==y.height)&&n(),y=p,g=requestAnimationFrame(w)}return n(),()=>{var p;m.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(p=h)==null||p.disconnect(),h=null,a&&cancelAnimationFrame(g)}}const Ke=ke,Xe=Se,Tt=Le,Je=(t,e,n)=>{const o=new Map,r={platform:je,...n},i={...r.platform,_c:o};return Re(t,e,{...r,platform:i})},Ge=({content:t,open:e,placement:n,offset:{mainAxis:o,crossAxis:r}={mainAxis:0,crossAxis:0}})=>u.OnBrowserCtx(i=>{const s=u.Value.toSignal(e),c=i.element;return u.LazyWhen(s,()=>u.Portal("body",u.html.div(u.OnElement(a=>{const l=a;return l.style.position="absolute",Ye(c,l,()=>{Je(c,l,{placement:n,strategy:"absolute",middleware:[Tt(),Ke({mainAxis:o,crossAxis:r}),Xe(),Tt()]}).then(({x:m,y:f})=>{l.style.top=`${f}px`,l.style.left=`${m}px`})})}),t())))(i)}),Gt=(t,e)=>{if(typeof e=="function")return Gt(t,{success:e});const n=e.failure??(r=>u.Fragment(u.OnDispose(r.on(console.error)),r.map(i=>`Error: ${i}`))),o=e.success;return u.OneOfType(u.Value.toSignal(t),{Success:r=>o(r.$.value),Failure:r=>n(r.$.error)})},Qe=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),Ze=t=>u.OnBrowserCtx(e=>{const{element:n}=e,o=u.makeProp({width:n.clientWidth,height:n.clientHeight}),r=u.renderableOfTNode(t(o))(e),i=()=>{o.set({width:n.clientWidth,height:n.clientHeight})};let s;return typeof ResizeObserver=="function"&&(s=new ResizeObserver(i),s.observe(n)),c=>{s==null||s.disconnect(),r(c)}}),tn=t=>e=>{const n=u.getWindow(),o=u.makeProp({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0}),r=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),s=>{n==null||n.removeEventListener("resize",i),r(s)}},Qt=(t,e)=>{const n=e.split("/").filter(r=>r!==""),o={};for(let r=0;r<t.length;r++){const i=t[r],s=n[r];if(!s&&i.type!=="catch-all")return null;if(i.type==="literal"){if(i.value!==s)return null}else if(i.type==="param")o[i.name]=s;else if(i.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}},Zt=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!==""),te=t=>{const e=t.map(n=>{const o=Zt(n);return{route:n,segments:o}});return function(o){for(const{segments:r,route:i}of e){const s=Qt(r,o);if(s)return{...s,route:i}}return null}},en=t=>{const e=te(Object.keys(t));return mt(n=>{const o=n.map(r=>{const i=e(r.pathname);if(i==null)throw console.error("No route found for",r),new Error("No route found");return{params:i.params,route:i.route,path:i.path,search:r.search,hash:r.hash}});return u.OneOfTuple(o.map(r=>[r.route,r]),t)})},et=60*1e3,ft=60*et,q=24*ft,kt=7*q,St=30*q,nn=365*q,on=[{max:et*90,value:et,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:ft*36,value:ft,name:"hour",past:{singular:"an hour ago",plural:"{} hours ago"},future:{singular:"in an hour",plural:"in {} hours"}},{max:q*10,value:q,name:"day",past:{singular:"yesterday",plural:"{} days ago"},future:{singular:"tomorrow",plural:"in {} days"}},{max:kt*6,value:kt,name:"week",past:{singular:"last week",plural:"{} weeks ago"},future:{singular:"in a week",plural:"in {} weeks"}},{max:St*18,value:St,name:"month",past:{singular:"last month",plural:"{} months ago"},future:{singular:"in a month",plural:"in {} months"}},{max:1/0,value:nn,name:"year",past:{singular:"last year",plural:"{} years ago"},future:{singular:"in a year",plural:"in {} years"}}];function Pt(t,e,n,o){const r=Math.round(t/e);return r<=1?n:o.replace("{}",r.toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0}))}function ee(t){const e=Math.abs(t);if(e<et)return t<0?"just now":"in a moment";for(const n of on)if(e<n.max)return t<0?Pt(e,n.value,n.past.singular,n.past.plural):Pt(e,n.value,n.future.singular,n.future.plural);throw new Error("unreachable")}const rn=(t,e)=>{const n=e!=null?u.Signal.is(e)?e.derive():u.makeProp(e):u.makeProp(new Date),o=u.makeComputedOf(t,n)((i,s)=>{const c=i.getTime()-s.getTime();return ee(c)}),r=u.Prop.is(n)?setInterval(()=>n.set(new Date),5e3):void 0;return o.onDispose(()=>{r!=null&&clearInterval(r),n.dispose()}),o};exports.Anchor=Nt;exports.AsyncResultView=Ht;exports.AutoFocus=ue;exports.AutoSelect=fe;exports.ElementSize=Ze;exports.HTMLTitle=he;exports.HiddenWhenEmpty=me;exports.InViewport=$t;exports.LocationProviderMarker=Dt;exports.PopOver=Ge;exports.ProvideAppearance=le;exports.ProvideLocation=ie;exports.ResultView=Gt;exports.Router=en;exports.SelectOnFocus=Qe;exports.UseAppearance=ae;exports.UseLocation=mt;exports.WhenInViewport=ge;exports.WindowSize=tn;exports._checkExtensionCondition=Ft;exports._getExtension=Ct;exports._makeRouteMatcher=te;exports._parseRouteSegments=Zt;exports.appearanceMarker=ht;exports.areLocationsEqual=se;exports.handleAnchorClick=Wt;exports.locationFromURL=Mt;exports.makeRelativeTime=rn;exports.matchesRoute=Qt;exports.setLocationFromUrl=Vt;exports.timeDiffToString=ee;exports.urlFromLocation=ce;
1
+ "use strict";var se=Object.defineProperty;var ce=(t,e,n)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var At=(t,e,n)=>ce(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tempots/dom"),Ft=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const n=e.split(".")||[];return n.length>1?"."+n.pop():void 0},Wt=(t,e)=>{const n=Ft(e);return n!=null&&(t.length===0||!t.some(o=>n==o))},le=(t,e,n,o)=>{let r=t.target;for(;r!=null&&!(r instanceof HTMLAnchorElement);)r=r.parentElement;if(r==null)return!0;const i=r;if(t.button!==0||t.ctrlKey||t.metaKey||i.target!=="_self"&&i.target!==""||i.getAttribute("download")!=null)return!0;const{pathname:s,search:c,hash:a}=i;if(o){const l=s+c+a,m=i.getAttribute("href");if(!(m!=null&&m.startsWith("#"))&&m!==l)return!0}return e?!1:Wt(n,s)},Dt=(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=>{le(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},Mt=u.makeProviderMark("LocationProvider"),ae=t=>u.Fragment(u.OnBrowserCtx(e=>u.Async(Promise.resolve().then(()=>require("./browser-location-D36kVbd7.cjs")).then(n=>n.ProvideBrowserLocation),n=>n(t))(e)),u.OnHeadlessCtx(e=>u.Async(Promise.resolve().then(()=>require("./headless-location-8Va85S-Q.cjs")).then(n=>n.ProvideHeadlessLocation),n=>n(e.container.currentURL,t))(e))),mt=t=>u.UseProvider(Mt,e=>n=>{const o=u.makeProp(e.value,e.equals);e.feedProp(o),o.on(e.set);const r=u.renderableOfTNode(t(o))(n);return i=>{o.dispose(),r(i)}}),ue=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,Vt=(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 r=n.hash;return r.startsWith("#")&&(r=r.substring(1)),{pathname:n.pathname,search:o,hash:r===""?void 0:r}},Nt=(t,e)=>{const n=Vt(e);return t.set(n),t},fe=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},Ht=(t,...e)=>{if(typeof t=="string"||u.Signal.is(t))return Ht({href:t},...e);const{href:n,...o}=t;return mt(r=>u.html.a(u.on.click(Dt(()=>(Nt(r,u.Value.get(n)),!0),o)),u.attr.href(n),...e))},dt=u.makeProviderMark("Appearance"),me=t=>{const e=u.getWindow(),n=e!=null&&e.matchMedia!=null&&e.matchMedia("(prefers-color-scheme: dark)").matches,o=u.makeProp(n?"dark":"light"),r=s=>{o.set(s.matches?"dark":"light")},i=e!=null&&e.matchMedia!=null?e.matchMedia("(prefers-color-scheme: dark)"):void 0;return i==null||i.addEventListener("change",r),u.Fragment(u.WithProvider(dt,o,t),u.OnDispose(()=>i==null?void 0:i.removeEventListener("change",r)))},de=t=>u.UseProvider(dt,t),$t=(t,e)=>{if(typeof e=="function")return $t(t,{success:e});const n=e.failure??(s=>u.Fragment(u.OnDispose(s.on(console.error)),s.map(c=>`Error: ${c}`))),o=e.success,r=e.loading??(()=>u.Empty),i=e.notAsked??(()=>u.Empty);return u.OneOfType(u.Value.toSignal(t),{AsyncSuccess:s=>o(s.$.value),AsyncFailure:s=>n(s.$.error),Loading:s=>r(s.$.previousValue??u.makeSignal(void 0)),NotAsked:i})},he=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.focus()},t);return()=>clearTimeout(n)}),pe=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.select()},t);return()=>clearTimeout(n)}),ge=u.OnElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),n=>{n&&t.style.setProperty(":empty",e)}}),ye=t=>u.Portal("head > title",u.attr.innerText(t)),we={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},J={partial:new Map,full:new Map},I={partial:null,full:null};function xe(t){return I[t]==null&&(I[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=J[t].get(n.target);o==null||o.set(n.isIntersecting)})},we[t])),I[t]}const zt=(t,e)=>{const n=u.makeProp(!1);return u.Fragment(u.OnElement(o=>{const r=typeof IntersectionObserver<"u"?xe(t):null;return J[t].set(o,n),r==null||r.observe(o),()=>{var i;n.dispose(),r==null||r.unobserve(o),J[t].delete(o),J[t].size===0&&((i=I[t])==null||i.disconnect(),I[t]=null)}}),u.renderableOfTNode(e(n)))},ve=(t,e,n)=>zt(t,o=>u.When(o,e,n??u.Empty)),G=Math.min,W=Math.max,Q=Math.round,X=Math.floor,k=t=>({x:t,y:t}),be={left:"right",right:"left",bottom:"top",top:"bottom"},Ae={start:"end",end:"start"};function Et(t,e,n){return W(t,G(e,n))}function nt(t,e){return typeof t=="function"?t(e):t}function D(t){return t.split("-")[0]}function ot(t){return t.split("-")[1]}function Bt(t){return t==="x"?"y":"x"}function Ut(t){return t==="y"?"height":"width"}function $(t){return["top","bottom"].includes(D(t))?"y":"x"}function _t(t){return Bt($(t))}function Ee(t,e,n){n===void 0&&(n=!1);const o=ot(t),r=_t(t),i=Ut(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Z(s)),[s,Z(s)]}function Oe(t){const e=Z(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>Ae[e])}function Re(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:s;default:return[]}}function ke(t,e,n,o){const r=ot(t);let i=Re(D(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(at)))),i}function Z(t){return t.replace(/left|right|bottom|top/g,e=>be[e])}function Te(t){return{top:0,right:0,bottom:0,left:0,...t}}function Le(t){return typeof t!="number"?Te(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function Ot(t,e,n){let{reference:o,floating:r}=t;const i=$(e),s=_t(e),c=Ut(s),a=D(e),l=i==="y",m=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,h=o[c]/2-r[c]/2;let d;switch(a){case"top":d={x:m,y:o.y-r.height};break;case"bottom":d={x:m,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:f};break;case"left":d={x:o.x-r.width,y:f};break;default:d={x:o.x,y:o.y}}switch(ot(e)){case"start":d[s]-=h*(n&&l?-1:1);break;case"end":d[s]+=h*(n&&l?-1:1);break}return d}const Se=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:m,y:f}=Ot(l,o,a),h=o,d={},g=0;for(let y=0;y<c.length;y++){const{name:w,fn:p}=c[y],{x,y:v,data:A,reset:b}=await p({x:m,y:f,initialPlacement:o,placement:h,strategy:r,middlewareData:d,rects:l,platform:s,elements:{reference:t,floating:e}});m=x??m,f=v??f,d={...d,[w]:{...d[w],...A}},b&&g<=50&&(g++,typeof b=="object"&&(b.placement&&(h=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):b.rects),{x:m,y:f}=Ot(l,h,a)),y=-1)}return{x:m,y:f,placement:h,strategy:r,middlewareData:d}};async function It(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=nt(e,t),g=Le(d),w=c[h?f==="floating"?"reference":"floating":f],p=tt(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:l,rootBoundary:m,strategy:a})),x=f==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.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=tt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:a}):x);return{top:(p.top-b.top+g.top)/A.y,bottom:(b.bottom-p.bottom+g.bottom)/A.y,left:(p.left-b.left+g.left)/A.x,right:(b.right-p.right+g.right)/A.x}}const Pe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:a,elements:l}=e,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=nt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const p=D(r),x=$(c),v=D(c)===c,A=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=h||(v||!y?[Z(c)]:Oe(c)),V=g!=="none";!h&&V&&b.push(...ke(c,y,g,A));const re=[c,...b],ct=await It(e,w),K=[];let U=((o=i.flip)==null?void 0:o.overflows)||[];if(m&&K.push(ct[p]),f){const F=Ee(r,s,A);K.push(ct[F[0]],ct[F[1]])}if(U=[...U,{placement:r,overflows:K}],!K.every(F=>F<=0)){var wt,xt;const F=(((wt=i.flip)==null?void 0:wt.index)||0)+1,bt=re[F];if(bt)return{data:{index:F,overflows:U},reset:{placement:bt}};let _=(xt=U.filter(N=>N.overflows[0]<=0).sort((N,S)=>N.overflows[1]-S.overflows[1])[0])==null?void 0:xt.placement;if(!_)switch(d){case"bestFit":{var vt;const N=(vt=U.filter(S=>{if(V){const P=$(S.placement);return P===x||P==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(P=>P>0).reduce((P,ie)=>P+ie,0)]).sort((S,P)=>S[1]-P[1])[0])==null?void 0:vt[0];N&&(_=N);break}case"initialPlacement":_=c;break}if(r!==_)return{reset:{placement:_}}}return{}}}};async function Ce(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=D(n),c=ot(n),a=$(n)==="y",l=["left","top"].includes(s)?-1:1,m=i&&a?-1:1,f=nt(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(d=c==="end"?g*-1:g),a?{x:d*m,y:h*l}:{x:h*l,y:d*m}}const Fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=e,a=await Ce(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:s}}}}},We=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:p,y:x}=w;return{x:p,y:x}}},...a}=nt(t,e),l={x:n,y:o},m=await It(e,a),f=$(D(r)),h=Bt(f);let d=l[h],g=l[f];if(i){const w=h==="y"?"top":"left",p=h==="y"?"bottom":"right",x=d+m[w],v=d-m[p];d=Et(x,d,v)}if(s){const w=f==="y"?"top":"left",p=f==="y"?"bottom":"right",x=g+m[w],v=g-m[p];g=Et(x,g,v)}const y=c.fn({...e,[h]:d,[f]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[h]:i,[f]:s}}}}}};function rt(){return typeof window<"u"}function B(t){return jt(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function L(t){var e;return(e=(jt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function jt(t){return rt()?t instanceof Node||t instanceof E(t).Node:!1}function O(t){return rt()?t instanceof Element||t instanceof E(t).Element:!1}function T(t){return rt()?t instanceof HTMLElement||t instanceof E(t).HTMLElement:!1}function Rt(t){return!rt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function Y(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=R(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function De(t){return["table","td","th"].includes(B(t))}function it(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function ht(t){const e=pt(),n=O(t)?R(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 Me(t){let e=C(t);for(;T(e)&&!z(e);){if(ht(e))return e;if(it(e))return null;e=C(e)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(B(t))}function R(t){return E(t).getComputedStyle(t)}function st(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function C(t){if(B(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Rt(t)&&t.host||L(t);return Rt(e)?e.host:e}function qt(t){const e=C(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:T(e)&&Y(e)?e:qt(e)}function j(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=qt(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=E(r);if(i){const c=ut(s);return e.concat(s,s.visualViewport||[],Y(r)?r:[],c&&n?j(c):[])}return e.concat(r,j(r,[],n))}function ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Yt(t){const e=R(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=T(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,c=Q(n)!==i||Q(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function gt(t){return O(t)?t:t.contextElement}function H(t){const e=gt(t);if(!T(e))return k(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=Yt(e);let s=(i?Q(n.width):n.width)/o,c=(i?Q(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Ve=k(0);function Kt(t){const e=E(t);return!pt()||!e.visualViewport?Ve:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ne(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 r=t.getBoundingClientRect(),i=gt(t);let s=k(1);e&&(o?O(o)&&(s=H(o)):s=H(t));const c=Ne(i,n,o)?Kt(i):k(0);let a=(r.left+c.x)/s.x,l=(r.top+c.y)/s.y,m=r.width/s.x,f=r.height/s.y;if(i){const h=E(i),d=o&&O(o)?E(o):o;let g=h,y=ut(g);for(;y&&o&&d!==g;){const w=H(y),p=y.getBoundingClientRect(),x=R(y),v=p.left+(y.clientLeft+parseFloat(x.paddingLeft))*w.x,A=p.top+(y.clientTop+parseFloat(x.paddingTop))*w.y;a*=w.x,l*=w.y,m*=w.x,f*=w.y,a+=v,l+=A,g=E(y),y=ut(g)}}return tt({width:m,height:f,x:a,y:l})}function yt(t,e){const n=st(t).scrollLeft;return e?e.left+n:M(L(t)).left+n}function Xt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:yt(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function He(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=L(o),c=e?it(e.floating):!1;if(o===s||c&&i)return n;let a={scrollLeft:0,scrollTop:0},l=k(1);const m=k(0),f=T(o);if((f||!f&&!i)&&((B(o)!=="body"||Y(s))&&(a=st(o)),T(o))){const d=M(o);l=H(o),m.x=d.x+o.clientLeft,m.y=d.y+o.clientTop}const h=s&&!f&&!i?Xt(s,a,!0):k(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+m.x+h.x,y:n.y*l.y-a.scrollTop*l.y+m.y+h.y}}function $e(t){return Array.from(t.getClientRects())}function ze(t){const e=L(t),n=st(t),o=t.ownerDocument.body,r=W(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=W(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+yt(t);const c=-n.scrollTop;return R(o).direction==="rtl"&&(s+=W(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}function Be(t,e){const n=E(t),o=L(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,a=0;if(r){i=r.width,s=r.height;const l=pt();(!l||l&&e==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:s,x:c,y:a}}function Ue(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=T(t)?H(t):k(1),s=t.clientWidth*i.x,c=t.clientHeight*i.y,a=r*i.x,l=o*i.y;return{width:s,height:c,x:a,y:l}}function kt(t,e,n){let o;if(e==="viewport")o=Be(t,n);else if(e==="document")o=ze(L(t));else if(O(e))o=Ue(e,n);else{const r=Kt(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return tt(o)}function Jt(t,e){const n=C(t);return n===e||!O(n)||z(n)?!1:R(n).position==="fixed"||Jt(n,e)}function _e(t,e){const n=e.get(t);if(n)return n;let o=j(t,[],!1).filter(c=>O(c)&&B(c)!=="body"),r=null;const i=R(t).position==="fixed";let s=i?C(t):t;for(;O(s)&&!z(s);){const c=R(s),a=ht(s);!a&&c.position==="fixed"&&(r=null),(i?!a&&!r:!a&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Y(s)&&!a&&Jt(t,s))?o=o.filter(m=>m!==s):r=c,s=C(s)}return e.set(t,o),o}function Ie(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?it(e)?[]:_e(e,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,m)=>{const f=kt(e,m,r);return l.top=W(f.top,l.top),l.right=G(f.right,l.right),l.bottom=G(f.bottom,l.bottom),l.left=W(f.left,l.left),l},kt(e,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function je(t){const{width:e,height:n}=Yt(t);return{width:e,height:n}}function qe(t,e,n){const o=T(e),r=L(e),i=n==="fixed",s=M(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const a=k(0);if(o||!o&&!i)if((B(e)!=="body"||Y(r))&&(c=st(e)),o){const h=M(e,!0,i,e);a.x=h.x+e.clientLeft,a.y=h.y+e.clientTop}else r&&(a.x=yt(r));const l=r&&!o&&!i?Xt(r,c):k(0),m=s.left+c.scrollLeft-a.x-l.x,f=s.top+c.scrollTop-a.y-l.y;return{x:m,y:f,width:s.width,height:s.height}}function lt(t){return R(t).position==="static"}function Tt(t,e){if(!T(t)||R(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return L(t)===n&&(n=n.ownerDocument.body),n}function Gt(t,e){const n=E(t);if(it(t))return n;if(!T(t)){let r=C(t);for(;r&&!z(r);){if(O(r)&&!lt(r))return r;r=C(r)}return n}let o=Tt(t,e);for(;o&&De(o)&&lt(o);)o=Tt(o,e);return o&&z(o)&&lt(o)&&!ht(o)?n:o||Me(t)||n}const Ye=async function(t){const e=this.getOffsetParent||Gt,n=this.getDimensions,o=await n(t.floating);return{reference:qe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ke(t){return R(t).direction==="rtl"}const Xe={convertOffsetParentRelativeRectToViewportRelativeRect:He,getDocumentElement:L,getClippingRect:Ie,getOffsetParent:Gt,getElementRects:Ye,getClientRects:$e,getDimensions:je,getScale:H,isElement:O,isRTL:Ke};function Je(t,e){let n=null,o;const r=L(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),i();const{left:l,top:m,width:f,height:h}=t.getBoundingClientRect();if(c||e(),!f||!h)return;const d=X(m),g=X(r.clientWidth-(l+f)),y=X(r.clientHeight-(m+h)),w=X(l),x={rootMargin:-d+"px "+-g+"px "+-y+"px "+-w+"px",threshold:W(0,G(1,a))||1};let v=!0;function A(b){const V=b[0].intersectionRatio;if(V!==a){if(!v)return s();V?s(!1,V):o=setTimeout(()=>{s(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(A,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(t)}return s(!0),i}function Ge(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=gt(t),m=r||i?[...l?j(l):[],...j(e)]:[];m.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),i&&p.addEventListener("resize",n)});const f=l&&c?Je(l,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(p=>{let[x]=p;x&&x.target===l&&d&&(d.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=d)==null||v.observe(e)})),n()}),l&&!a&&d.observe(l),d.observe(e));let g,y=a?M(t):null;a&&w();function w(){const p=M(t);y&&(p.x!==y.x||p.y!==y.y||p.width!==y.width||p.height!==y.height)&&n(),y=p,g=requestAnimationFrame(w)}return n(),()=>{var p;m.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(p=d)==null||p.disconnect(),d=null,a&&cancelAnimationFrame(g)}}const Qe=Fe,Ze=We,Lt=Pe,tn=(t,e,n)=>{const o=new Map,r={platform:Xe,...n},i={...r.platform,_c:o};return Se(t,e,{...r,platform:i})},en=({content:t,open:e,placement:n,offset:{mainAxis:o,crossAxis:r}={mainAxis:0,crossAxis:0}})=>u.OnBrowserCtx(i=>{const s=u.Value.toSignal(e),c=i.element;return u.LazyWhen(s,()=>u.Portal("body",u.html.div(u.OnElement(a=>{const l=a;return l.style.position="absolute",Ge(c,l,()=>{tn(c,l,{placement:n,strategy:"absolute",middleware:[Lt(),Qe({mainAxis:o,crossAxis:r}),Ze(),Lt()]}).then(({x:m,y:f})=>{l.style.top=`${f}px`,l.style.left=`${m}px`})})}),t())))(i)}),Qt=(t,e)=>{if(typeof e=="function")return Qt(t,{success:e});const n=e.failure??(r=>u.Fragment(u.OnDispose(r.on(console.error)),r.map(i=>`Error: ${i}`))),o=e.success;return u.OneOfType(u.Value.toSignal(t),{Success:r=>o(r.$.value),Failure:r=>n(r.$.error)})},nn=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),on=t=>u.OnBrowserCtx(e=>{const{element:n}=e,o=u.makeProp({width:n.clientWidth,height:n.clientHeight}),r=u.renderableOfTNode(t(o))(e),i=()=>{o.set({width:n.clientWidth,height:n.clientHeight})};let s;return typeof ResizeObserver=="function"&&(s=new ResizeObserver(i),s.observe(n)),c=>{s==null||s.disconnect(),r(c)}}),rn=t=>e=>{const n=u.getWindow(),o=u.makeProp({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0}),r=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),s=>{n==null||n.removeEventListener("resize",i),r(s)}},Zt=(t,e)=>{const n=e.split("/").filter(r=>r!==""),o={};for(let r=0;r<t.length;r++){const i=t[r],s=n[r];if(!s&&i.type!=="catch-all")return null;if(i.type==="literal"){if(i.value!==s)return null}else if(i.type==="param")o[i.name]=s;else if(i.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}},te=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!==""),ee=t=>{const e=t.map(n=>{const o=te(n);return{route:n,segments:o}});return function(o){for(const{segments:r,route:i}of e){const s=Zt(r,o);if(s)return{...s,route:i}}return null}},sn=t=>{const e=ee(Object.keys(t));return mt(n=>{const o=n.map(r=>{const i=e(r.pathname);if(i==null)throw console.error("No route found for",r),new Error("No route found");return{params:i.params,route:i.route,path:i.path,search:r.search,hash:r.hash}});return u.OneOfTuple(o.map(r=>[r.route,r]),t)})},et=60*1e3,ft=60*et,q=24*ft,St=7*q,Pt=30*q,cn=365*q,ln=[{max:et*90,value:et,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:ft*36,value:ft,name:"hour",past:{singular:"an hour ago",plural:"{} hours ago"},future:{singular:"in an hour",plural:"in {} hours"}},{max:q*10,value:q,name:"day",past:{singular:"yesterday",plural:"{} days ago"},future:{singular:"tomorrow",plural:"in {} days"}},{max:St*6,value:St,name:"week",past:{singular:"last week",plural:"{} weeks ago"},future:{singular:"in a week",plural:"in {} weeks"}},{max:Pt*18,value:Pt,name:"month",past:{singular:"last month",plural:"{} months ago"},future:{singular:"in a month",plural:"in {} months"}},{max:1/0,value:cn,name:"year",past:{singular:"last year",plural:"{} years ago"},future:{singular:"in a year",plural:"in {} years"}}];function Ct(t,e,n,o){const r=Math.round(t/e);return r<=1?n:o.replace("{}",r.toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0}))}function ne(t){const e=Math.abs(t);if(e<et)return t<0?"just now":"in a moment";for(const n of ln)if(e<n.max)return t<0?Ct(e,n.value,n.past.singular,n.past.plural):Ct(e,n.value,n.future.singular,n.future.plural);throw new Error("unreachable")}const an=(t,e)=>{const n=e!=null?u.Signal.is(e)?e.derive():u.makeProp(e):u.makeProp(new Date),o=u.makeComputedOf(t,n)((i,s)=>{const c=i.getTime()-s.getTime();return ne(c)}),r=u.Prop.is(n)?setInterval(()=>n.set(new Date),5e3):void 0;return o.onDispose(()=>{r!=null&&clearInterval(r),n.dispose()}),o};class oe extends u.Prop{constructor(){super(...arguments);At(this,"tick",()=>this.update(n=>n+1))}}const un=(t=0)=>new oe(t,(e,n)=>e===n);exports.Anchor=Ht;exports.AsyncResultView=$t;exports.AutoFocus=he;exports.AutoSelect=pe;exports.ElementSize=on;exports.HTMLTitle=ye;exports.HiddenWhenEmpty=ge;exports.InViewport=zt;exports.LocationProviderMarker=Mt;exports.PopOver=en;exports.ProvideAppearance=me;exports.ProvideLocation=ae;exports.ResultView=Qt;exports.Router=sn;exports.SelectOnFocus=nn;exports.Ticker=oe;exports.UseAppearance=de;exports.UseLocation=mt;exports.WhenInViewport=ve;exports.WindowSize=rn;exports._checkExtensionCondition=Wt;exports._getExtension=Ft;exports._makeRouteMatcher=ee;exports._parseRouteSegments=te;exports.appearanceMarker=dt;exports.areLocationsEqual=ue;exports.handleAnchorClick=Dt;exports.locationFromURL=Vt;exports.makeRelativeTime=an;exports.makeTicker=un;exports.matchesRoute=Zt;exports.setLocationFromUrl=Nt;exports.timeDiffToString=ne;exports.urlFromLocation=fe;
package/index.d.ts CHANGED
@@ -17,3 +17,4 @@ export * from './renderables/router/match';
17
17
  export * from './renderables/router/route-info';
18
18
  export * from './renderables/router/router';
19
19
  export * from './utils/make-relative-time';
20
+ export * from './utils/ticker';
package/index.js CHANGED
@@ -1,13 +1,16 @@
1
- import { makeProviderMark as $t, Fragment as q, OnBrowserCtx as yt, Async as St, OnHeadlessCtx as ce, UseProvider as Ht, makeProp as D, renderableOfTNode as rt, getWindow as wt, Signal as zt, html as Bt, on as Ut, Value as it, attr as It, WithProvider as le, OnDispose as xt, Empty as dt, OneOfType as _t, makeSignal as ae, OnElement as K, Portal as jt, When as ue, LazyWhen as fe, OneOfTuple as he, makeComputedOf as de, Prop as me } from "@tempots/dom";
2
- const pe = (t) => {
1
+ var ae = Object.defineProperty;
2
+ var ue = (t, e, n) => e in t ? ae(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var kt = (t, e, n) => ue(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { makeProviderMark as Ht, Fragment as q, OnBrowserCtx as yt, Async as St, OnHeadlessCtx as fe, UseProvider as zt, makeProp as D, renderableOfTNode as rt, getWindow as wt, Signal as Bt, html as Ut, on as It, Value as it, attr as _t, WithProvider as he, OnDispose as xt, Empty as dt, OneOfType as jt, makeSignal as de, OnElement as K, Portal as Yt, When as me, LazyWhen as pe, OneOfTuple as ge, makeComputedOf as ye, Prop as qt } from "@tempots/dom";
5
+ const we = (t) => {
3
6
  const e = t.split("/").pop();
4
7
  if (e == null || e.startsWith(".")) return;
5
8
  const n = e.split(".") || [];
6
9
  return n.length > 1 ? "." + n.pop() : void 0;
7
- }, ge = (t, e) => {
8
- const n = pe(e);
10
+ }, xe = (t, e) => {
11
+ const n = we(e);
9
12
  return n != null && (t.length === 0 || !t.some((o) => n == o));
10
- }, ye = (t, e, n, o) => {
13
+ }, ve = (t, e, n, o) => {
11
14
  let r = t.target;
12
15
  for (; r != null && !(r instanceof HTMLAnchorElement); )
13
16
  r = r.parentElement;
@@ -22,8 +25,8 @@ const pe = (t) => {
22
25
  if (!(f != null && f.startsWith("#")) && f !== l)
23
26
  return !0;
24
27
  }
25
- return e ? !1 : ge(n, s);
26
- }, we = (t, e = {
28
+ return e ? !1 : xe(n, s);
29
+ }, be = (t, e = {
27
30
  ignoreUrlWithExtension: !0,
28
31
  allowedExtensions: [],
29
32
  ignoreExternalUrl: !0
@@ -32,30 +35,30 @@ const pe = (t) => {
32
35
  (o) => o.startsWith(".") ? o : "." + o
33
36
  ) : [];
34
37
  return (o) => {
35
- ye(
38
+ ve(
36
39
  o,
37
40
  e.ignoreUrlWithExtension ?? !0,
38
41
  n,
39
42
  e.ignoreExternalUrl ?? !0
40
43
  ) || t() && o.preventDefault();
41
44
  };
42
- }, xe = $t("LocationProvider"), gn = (t) => q(
45
+ }, Ae = Ht("LocationProvider"), bn = (t) => q(
43
46
  yt((e) => St(
44
47
  import("./browser-location-12vUH3Kv.js").then((n) => n.ProvideBrowserLocation),
45
48
  (n) => n(t)
46
49
  )(e)),
47
- ce((e) => St(
50
+ fe((e) => St(
48
51
  import("./headless-location-Ba_ht5ZQ.js").then((n) => n.ProvideHeadlessLocation),
49
52
  (n) => n(e.container.currentURL, t)
50
53
  )(e))
51
- ), Yt = (t) => Ht(xe, (e) => (n) => {
54
+ ), Kt = (t) => zt(Ae, (e) => (n) => {
52
55
  const o = D(e.value, e.equals);
53
56
  e.feedProp(o), o.on(e.set);
54
57
  const r = rt(t(o))(n);
55
58
  return (i) => {
56
59
  o.dispose(), r(i);
57
60
  };
58
- }), yn = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, ve = (t, e) => {
61
+ }), An = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, Ee = (t, e) => {
59
62
  var i;
60
63
  const n = new URL(t, e ?? ((i = wt()) == null ? void 0 : i.location.toString())), o = Object.fromEntries(n.searchParams.entries());
61
64
  let r = n.hash;
@@ -64,60 +67,60 @@ const pe = (t) => {
64
67
  search: o,
65
68
  hash: r === "" ? void 0 : r
66
69
  };
67
- }, be = (t, e) => {
68
- const n = ve(e);
70
+ }, Re = (t, e) => {
71
+ const n = Ee(e);
69
72
  return t.set(n), t;
70
- }, wn = (t) => {
73
+ }, En = (t) => {
71
74
  const n = new URLSearchParams(t.search).toString(), o = t.hash;
72
75
  return `${t.pathname}${n ? `?${n}` : ""}${o ? `#${o}` : ""}`;
73
- }, Ae = (t, ...e) => {
74
- if (typeof t == "string" || zt.is(t))
75
- return Ae({ href: t }, ...e);
76
+ }, Oe = (t, ...e) => {
77
+ if (typeof t == "string" || Bt.is(t))
78
+ return Oe({ href: t }, ...e);
76
79
  const { href: n, ...o } = t;
77
- return Yt((r) => Bt.a(
78
- Ut.click(
79
- we(() => (be(r, it.get(n)), !0), o)
80
+ return Kt((r) => Ut.a(
81
+ It.click(
82
+ be(() => (Re(r, it.get(n)), !0), o)
80
83
  ),
81
- It.href(n),
84
+ _t.href(n),
82
85
  ...e
83
86
  ));
84
- }, qt = $t("Appearance"), xn = (t) => {
87
+ }, Xt = Ht("Appearance"), Rn = (t) => {
85
88
  const e = wt(), n = e != null && e.matchMedia != null && e.matchMedia("(prefers-color-scheme: dark)").matches, o = D(n ? "dark" : "light"), r = (s) => {
86
89
  o.set(s.matches ? "dark" : "light");
87
90
  }, i = e != null && e.matchMedia != null ? e.matchMedia("(prefers-color-scheme: dark)") : void 0;
88
91
  return i == null || i.addEventListener("change", r), q(
89
- le(qt, o, t),
92
+ he(Xt, o, t),
90
93
  xt(() => i == null ? void 0 : i.removeEventListener("change", r))
91
94
  );
92
- }, vn = (t) => Ht(qt, t), Ee = (t, e) => {
95
+ }, On = (t) => zt(Xt, t), Le = (t, e) => {
93
96
  if (typeof e == "function")
94
- return Ee(t, { success: e });
97
+ return Le(t, { success: e });
95
98
  const n = e.failure ?? ((s) => q(
96
99
  xt(s.on(console.error)),
97
100
  s.map((c) => `Error: ${c}`)
98
101
  )), o = e.success, r = e.loading ?? (() => dt), i = e.notAsked ?? (() => dt);
99
- return _t(it.toSignal(t), {
102
+ return jt(it.toSignal(t), {
100
103
  AsyncSuccess: (s) => o(s.$.value),
101
104
  AsyncFailure: (s) => n(s.$.error),
102
- Loading: (s) => r(s.$.previousValue ?? ae(void 0)),
105
+ Loading: (s) => r(s.$.previousValue ?? de(void 0)),
103
106
  NotAsked: i
104
107
  });
105
- }, bn = (t = 10) => K((e) => {
108
+ }, Ln = (t = 10) => K((e) => {
106
109
  const n = setTimeout(() => {
107
110
  e == null || e.focus();
108
111
  }, t);
109
112
  return () => clearTimeout(n);
110
- }), An = (t = 10) => K((e) => {
113
+ }), Tn = (t = 10) => K((e) => {
111
114
  const n = setTimeout(() => {
112
115
  e == null || e.select();
113
116
  }, t);
114
117
  return () => clearTimeout(n);
115
- }), En = K((t) => {
118
+ }), kn = K((t) => {
116
119
  const e = t.style.getPropertyValue(":empty");
117
120
  return t.style.setProperty(":empty", "display:none"), (n) => {
118
121
  n && t.style.setProperty(":empty", e);
119
122
  };
120
- }), Rn = (t) => jt("head > title", It.innerText(t)), Re = {
123
+ }), Sn = (t) => Yt("head > title", _t.innerText(t)), Te = {
121
124
  partial: {
122
125
  root: null,
123
126
  rootMargin: "0px",
@@ -135,19 +138,19 @@ const pe = (t) => {
135
138
  partial: null,
136
139
  full: null
137
140
  };
138
- function Oe(t) {
141
+ function ke(t) {
139
142
  return _[t] == null && (_[t] = new IntersectionObserver((e) => {
140
143
  e.forEach((n) => {
141
144
  const o = Q[t].get(n.target);
142
145
  o == null || o.set(n.isIntersecting);
143
146
  });
144
- }, Re[t])), _[t];
147
+ }, Te[t])), _[t];
145
148
  }
146
- const Le = (t, e) => {
149
+ const Se = (t, e) => {
147
150
  const n = D(!1);
148
151
  return q(
149
152
  K((o) => {
150
- const r = typeof IntersectionObserver < "u" ? Oe(t) : null;
153
+ const r = typeof IntersectionObserver < "u" ? ke(t) : null;
151
154
  return Q[t].set(o, n), r == null || r.observe(o), () => {
152
155
  var i;
153
156
  n.dispose(), r == null || r.unobserve(o), Q[t].delete(o), Q[t].size === 0 && ((i = _[t]) == null || i.disconnect(), _[t] = null);
@@ -155,15 +158,15 @@ const Le = (t, e) => {
155
158
  }),
156
159
  rt(e(n))
157
160
  );
158
- }, On = (t, e, n) => Le(t, (o) => ue(o, e, n ?? dt)), Z = Math.min, W = Math.max, tt = Math.round, G = Math.floor, O = (t) => ({
161
+ }, Cn = (t, e, n) => Se(t, (o) => me(o, e, n ?? dt)), Z = Math.min, W = Math.max, tt = Math.round, G = Math.floor, O = (t) => ({
159
162
  x: t,
160
163
  y: t
161
- }), Te = {
164
+ }), Ce = {
162
165
  left: "right",
163
166
  right: "left",
164
167
  bottom: "top",
165
168
  top: "bottom"
166
- }, Se = {
169
+ }, Pe = {
167
170
  start: "end",
168
171
  end: "start"
169
172
  };
@@ -179,32 +182,32 @@ function F(t) {
179
182
  function ct(t) {
180
183
  return t.split("-")[1];
181
184
  }
182
- function Kt(t) {
185
+ function Jt(t) {
183
186
  return t === "x" ? "y" : "x";
184
187
  }
185
- function Xt(t) {
188
+ function Gt(t) {
186
189
  return t === "y" ? "height" : "width";
187
190
  }
188
191
  function H(t) {
189
192
  return ["top", "bottom"].includes(F(t)) ? "y" : "x";
190
193
  }
191
- function Jt(t) {
192
- return Kt(H(t));
194
+ function Qt(t) {
195
+ return Jt(H(t));
193
196
  }
194
- function Ce(t, e, n) {
197
+ function We(t, e, n) {
195
198
  n === void 0 && (n = !1);
196
- const o = ct(t), r = Jt(t), i = Xt(r);
199
+ const o = ct(t), r = Qt(t), i = Gt(r);
197
200
  let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
198
201
  return e.reference[i] > e.floating[i] && (s = et(s)), [s, et(s)];
199
202
  }
200
- function ke(t) {
203
+ function De(t) {
201
204
  const e = et(t);
202
205
  return [mt(t), e, mt(e)];
203
206
  }
204
207
  function mt(t) {
205
- return t.replace(/start|end/g, (e) => Se[e]);
208
+ return t.replace(/start|end/g, (e) => Pe[e]);
206
209
  }
207
- function Pe(t, e, n) {
210
+ function Fe(t, e, n) {
208
211
  const o = ["left", "right"], r = ["right", "left"], i = ["top", "bottom"], s = ["bottom", "top"];
209
212
  switch (t) {
210
213
  case "top":
@@ -217,15 +220,15 @@ function Pe(t, e, n) {
217
220
  return [];
218
221
  }
219
222
  }
220
- function We(t, e, n, o) {
223
+ function Me(t, e, n, o) {
221
224
  const r = ct(t);
222
- let i = Pe(F(t), n === "start", o);
225
+ let i = Fe(F(t), n === "start", o);
223
226
  return r && (i = i.map((s) => s + "-" + r), e && (i = i.concat(i.map(mt)))), i;
224
227
  }
225
228
  function et(t) {
226
- return t.replace(/left|right|bottom|top/g, (e) => Te[e]);
229
+ return t.replace(/left|right|bottom|top/g, (e) => Ce[e]);
227
230
  }
228
- function De(t) {
231
+ function Ne(t) {
229
232
  return {
230
233
  top: 0,
231
234
  right: 0,
@@ -234,8 +237,8 @@ function De(t) {
234
237
  ...t
235
238
  };
236
239
  }
237
- function Fe(t) {
238
- return typeof t != "number" ? De(t) : {
240
+ function Ve(t) {
241
+ return typeof t != "number" ? Ne(t) : {
239
242
  top: t,
240
243
  right: t,
241
244
  bottom: t,
@@ -260,12 +263,12 @@ function nt(t) {
260
263
  y: n
261
264
  };
262
265
  }
263
- function kt(t, e, n) {
266
+ function Pt(t, e, n) {
264
267
  let {
265
268
  reference: o,
266
269
  floating: r
267
270
  } = t;
268
- const i = H(e), s = Jt(e), c = Xt(s), a = F(e), l = i === "y", f = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, d = o[c] / 2 - r[c] / 2;
271
+ const i = H(e), s = Qt(e), c = Gt(s), a = F(e), l = i === "y", f = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, d = o[c] / 2 - r[c] / 2;
269
272
  let h;
270
273
  switch (a) {
271
274
  case "top":
@@ -308,7 +311,7 @@ function kt(t, e, n) {
308
311
  }
309
312
  return h;
310
313
  }
311
- const Me = async (t, e, n) => {
314
+ const $e = async (t, e, n) => {
312
315
  const {
313
316
  placement: o = "bottom",
314
317
  strategy: r = "absolute",
@@ -322,7 +325,7 @@ const Me = async (t, e, n) => {
322
325
  }), {
323
326
  x: f,
324
327
  y: u
325
- } = kt(l, o, a), d = o, h = {}, p = 0;
328
+ } = Pt(l, o, a), d = o, h = {}, p = 0;
326
329
  for (let g = 0; g < c.length; g++) {
327
330
  const {
328
331
  name: y,
@@ -359,7 +362,7 @@ const Me = async (t, e, n) => {
359
362
  }) : v.rects), {
360
363
  x: f,
361
364
  y: u
362
- } = kt(l, d, a)), g = -1);
365
+ } = Pt(l, d, a)), g = -1);
363
366
  }
364
367
  return {
365
368
  x: f,
@@ -369,7 +372,7 @@ const Me = async (t, e, n) => {
369
372
  middlewareData: h
370
373
  };
371
374
  };
372
- async function Gt(t, e) {
375
+ async function Zt(t, e) {
373
376
  var n;
374
377
  e === void 0 && (e = {});
375
378
  const {
@@ -385,7 +388,7 @@ async function Gt(t, e) {
385
388
  elementContext: u = "floating",
386
389
  altBoundary: d = !1,
387
390
  padding: h = 0
388
- } = st(e, t), p = Fe(h), y = c[d ? u === "floating" ? "reference" : "floating" : u], m = nt(await i.getClippingRect({
391
+ } = st(e, t), p = Ve(h), y = c[d ? u === "floating" ? "reference" : "floating" : u], m = nt(await i.getClippingRect({
389
392
  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)),
390
393
  boundary: l,
391
394
  rootBoundary: f,
@@ -414,7 +417,7 @@ async function Gt(t, e) {
414
417
  right: (v.right - m.right + p.right) / b.x
415
418
  };
416
419
  }
417
- const Ne = function(t) {
420
+ const He = function(t) {
418
421
  return t === void 0 && (t = {}), {
419
422
  name: "flip",
420
423
  options: t,
@@ -438,12 +441,12 @@ const Ne = function(t) {
438
441
  } = st(t, e);
439
442
  if ((n = i.arrow) != null && n.alignmentOffset)
440
443
  return {};
441
- const m = F(r), w = H(c), x = F(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), v = d || (x || !g ? [et(c)] : ke(c)), N = p !== "none";
442
- !d && N && v.push(...We(c, g, p, b));
443
- const ie = [c, ...v], ft = await Gt(e, y), J = [];
444
+ const m = F(r), w = H(c), x = F(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), v = d || (x || !g ? [et(c)] : De(c)), N = p !== "none";
445
+ !d && N && v.push(...Me(c, g, p, b));
446
+ const ce = [c, ...v], ft = await Zt(e, y), J = [];
444
447
  let U = ((o = i.flip) == null ? void 0 : o.overflows) || [];
445
448
  if (f && J.push(ft[m]), u) {
446
- const P = Ce(r, s, b);
449
+ const P = We(r, s, b);
447
450
  J.push(ft[P[0]], ft[P[1]]);
448
451
  }
449
452
  if (U = [...U, {
@@ -451,7 +454,7 @@ const Ne = function(t) {
451
454
  overflows: J
452
455
  }], !J.every((P) => P <= 0)) {
453
456
  var Rt, Ot;
454
- const P = (((Rt = i.flip) == null ? void 0 : Rt.index) || 0) + 1, Tt = ie[P];
457
+ const P = (((Rt = i.flip) == null ? void 0 : Rt.index) || 0) + 1, Tt = ce[P];
455
458
  if (Tt)
456
459
  return {
457
460
  data: {
@@ -462,20 +465,20 @@ const Ne = function(t) {
462
465
  placement: Tt
463
466
  }
464
467
  };
465
- let I = (Ot = U.filter((V) => V.overflows[0] <= 0).sort((V, S) => V.overflows[1] - S.overflows[1])[0]) == null ? void 0 : Ot.placement;
468
+ let I = (Ot = U.filter((V) => V.overflows[0] <= 0).sort((V, k) => V.overflows[1] - k.overflows[1])[0]) == null ? void 0 : Ot.placement;
466
469
  if (!I)
467
470
  switch (h) {
468
471
  case "bestFit": {
469
472
  var Lt;
470
- const V = (Lt = U.filter((S) => {
473
+ const V = (Lt = U.filter((k) => {
471
474
  if (N) {
472
- const C = H(S.placement);
473
- return C === w || // Create a bias to the `y` side axis due to horizontal
475
+ const S = H(k.placement);
476
+ return S === w || // Create a bias to the `y` side axis due to horizontal
474
477
  // reading directions favoring greater width.
475
- C === "y";
478
+ S === "y";
476
479
  }
477
480
  return !0;
478
- }).map((S) => [S.placement, S.overflows.filter((C) => C > 0).reduce((C, se) => C + se, 0)]).sort((S, C) => S[1] - C[1])[0]) == null ? void 0 : Lt[0];
481
+ }).map((k) => [k.placement, k.overflows.filter((S) => S > 0).reduce((S, le) => S + le, 0)]).sort((k, S) => k[1] - S[1])[0]) == null ? void 0 : Lt[0];
479
482
  V && (I = V);
480
483
  break;
481
484
  }
@@ -494,7 +497,7 @@ const Ne = function(t) {
494
497
  }
495
498
  };
496
499
  };
497
- async function Ve(t, e) {
500
+ async function ze(t, e) {
498
501
  const {
499
502
  placement: n,
500
503
  platform: o,
@@ -521,7 +524,7 @@ async function Ve(t, e) {
521
524
  y: h * f
522
525
  };
523
526
  }
524
- const $e = function(t) {
527
+ const Be = function(t) {
525
528
  return t === void 0 && (t = 0), {
526
529
  name: "offset",
527
530
  options: t,
@@ -532,7 +535,7 @@ const $e = function(t) {
532
535
  y: i,
533
536
  placement: s,
534
537
  middlewareData: c
535
- } = e, a = await Ve(e, t);
538
+ } = e, a = await ze(e, t);
536
539
  return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
537
540
  x: r + a.x,
538
541
  y: i + a.y,
@@ -543,7 +546,7 @@ const $e = function(t) {
543
546
  };
544
547
  }
545
548
  };
546
- }, He = function(t) {
549
+ }, Ue = function(t) {
547
550
  return t === void 0 && (t = {}), {
548
551
  name: "shift",
549
552
  options: t,
@@ -571,7 +574,7 @@ const $e = function(t) {
571
574
  } = st(t, e), l = {
572
575
  x: n,
573
576
  y: o
574
- }, f = await Gt(e, a), u = H(F(r)), d = Kt(u);
577
+ }, f = await Zt(e, a), u = H(F(r)), d = Jt(u);
575
578
  let h = l[d], p = l[u];
576
579
  if (i) {
577
580
  const y = d === "y" ? "top" : "left", m = d === "y" ? "bottom" : "right", w = h + f[y], x = h - f[m];
@@ -604,7 +607,7 @@ function lt() {
604
607
  return typeof window < "u";
605
608
  }
606
609
  function B(t) {
607
- return Qt(t) ? (t.nodeName || "").toLowerCase() : "#document";
610
+ return te(t) ? (t.nodeName || "").toLowerCase() : "#document";
608
611
  }
609
612
  function A(t) {
610
613
  var e;
@@ -612,9 +615,9 @@ function A(t) {
612
615
  }
613
616
  function T(t) {
614
617
  var e;
615
- return (e = (Qt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
618
+ return (e = (te(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
616
619
  }
617
- function Qt(t) {
620
+ function te(t) {
618
621
  return lt() ? t instanceof Node || t instanceof A(t).Node : !1;
619
622
  }
620
623
  function E(t) {
@@ -623,7 +626,7 @@ function E(t) {
623
626
  function L(t) {
624
627
  return lt() ? t instanceof HTMLElement || t instanceof A(t).HTMLElement : !1;
625
628
  }
626
- function Pt(t) {
629
+ function Wt(t) {
627
630
  return !lt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
628
631
  }
629
632
  function X(t) {
@@ -635,7 +638,7 @@ function X(t) {
635
638
  } = R(t);
636
639
  return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(r);
637
640
  }
638
- function ze(t) {
641
+ function Ie(t) {
639
642
  return ["table", "td", "th"].includes(B(t));
640
643
  }
641
644
  function at(t) {
@@ -651,14 +654,14 @@ function vt(t) {
651
654
  const e = bt(), n = E(t) ? R(t) : t;
652
655
  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));
653
656
  }
654
- function Be(t) {
655
- let e = k(t);
657
+ function _e(t) {
658
+ let e = C(t);
656
659
  for (; L(e) && !z(e); ) {
657
660
  if (vt(e))
658
661
  return e;
659
662
  if (at(e))
660
663
  return null;
661
- e = k(e);
664
+ e = C(e);
662
665
  }
663
666
  return null;
664
667
  }
@@ -680,26 +683,26 @@ function ut(t) {
680
683
  scrollTop: t.scrollY
681
684
  };
682
685
  }
683
- function k(t) {
686
+ function C(t) {
684
687
  if (B(t) === "html")
685
688
  return t;
686
689
  const e = (
687
690
  // Step into the shadow DOM of the parent of a slotted node.
688
691
  t.assignedSlot || // DOM Element detected.
689
692
  t.parentNode || // ShadowRoot detected.
690
- Pt(t) && t.host || // Fallback.
693
+ Wt(t) && t.host || // Fallback.
691
694
  T(t)
692
695
  );
693
- return Pt(e) ? e.host : e;
696
+ return Wt(e) ? e.host : e;
694
697
  }
695
- function Zt(t) {
696
- const e = k(t);
697
- return z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : L(e) && X(e) ? e : Zt(e);
698
+ function ee(t) {
699
+ const e = C(t);
700
+ return z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : L(e) && X(e) ? e : ee(e);
698
701
  }
699
702
  function j(t, e, n) {
700
703
  var o;
701
704
  e === void 0 && (e = []), n === void 0 && (n = !0);
702
- const r = Zt(t), i = r === ((o = t.ownerDocument) == null ? void 0 : o.body), s = A(r);
705
+ const r = ee(t), i = r === ((o = t.ownerDocument) == null ? void 0 : o.body), s = A(r);
703
706
  if (i) {
704
707
  const c = pt(s);
705
708
  return e.concat(s, s.visualViewport || [], X(r) ? r : [], c && n ? j(c) : []);
@@ -709,7 +712,7 @@ function j(t, e, n) {
709
712
  function pt(t) {
710
713
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
711
714
  }
712
- function te(t) {
715
+ function ne(t) {
713
716
  const e = R(t);
714
717
  let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
715
718
  const r = L(t), i = r ? t.offsetWidth : n, s = r ? t.offsetHeight : o, c = tt(n) !== i || tt(o) !== s;
@@ -730,22 +733,22 @@ function $(t) {
730
733
  width: o,
731
734
  height: r,
732
735
  $: i
733
- } = te(e);
736
+ } = ne(e);
734
737
  let s = (i ? tt(n.width) : n.width) / o, c = (i ? tt(n.height) : n.height) / r;
735
738
  return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
736
739
  x: s,
737
740
  y: c
738
741
  };
739
742
  }
740
- const Ue = /* @__PURE__ */ O(0);
741
- function ee(t) {
743
+ const je = /* @__PURE__ */ O(0);
744
+ function oe(t) {
742
745
  const e = A(t);
743
- return !bt() || !e.visualViewport ? Ue : {
746
+ return !bt() || !e.visualViewport ? je : {
744
747
  x: e.visualViewport.offsetLeft,
745
748
  y: e.visualViewport.offsetTop
746
749
  };
747
750
  }
748
- function Ie(t, e, n) {
751
+ function Ye(t, e, n) {
749
752
  return e === void 0 && (e = !1), !n || e && n !== A(t) ? !1 : e;
750
753
  }
751
754
  function M(t, e, n, o) {
@@ -753,7 +756,7 @@ function M(t, e, n, o) {
753
756
  const r = t.getBoundingClientRect(), i = At(t);
754
757
  let s = O(1);
755
758
  e && (o ? E(o) && (s = $(o)) : s = $(t));
756
- const c = Ie(i, n, o) ? ee(i) : O(0);
759
+ const c = Ye(i, n, o) ? oe(i) : O(0);
757
760
  let a = (r.left + c.x) / s.x, l = (r.top + c.y) / s.y, f = r.width / s.x, u = r.height / s.y;
758
761
  if (i) {
759
762
  const d = A(i), h = o && E(o) ? A(o) : o;
@@ -774,7 +777,7 @@ function Et(t, e) {
774
777
  const n = ut(t).scrollLeft;
775
778
  return e ? e.left + n : M(T(t)).left + n;
776
779
  }
777
- function ne(t, e, n) {
780
+ function re(t, e, n) {
778
781
  n === void 0 && (n = !1);
779
782
  const o = t.getBoundingClientRect(), r = o.left + e.scrollLeft - (n ? 0 : (
780
783
  // RTL <body> scrollbar.
@@ -785,7 +788,7 @@ function ne(t, e, n) {
785
788
  y: i
786
789
  };
787
790
  }
788
- function _e(t) {
791
+ function qe(t) {
789
792
  let {
790
793
  elements: e,
791
794
  rect: n,
@@ -804,7 +807,7 @@ function _e(t) {
804
807
  const h = M(o);
805
808
  l = $(o), f.x = h.x + o.clientLeft, f.y = h.y + o.clientTop;
806
809
  }
807
- const d = s && !u && !i ? ne(s, a, !0) : O(0);
810
+ const d = s && !u && !i ? re(s, a, !0) : O(0);
808
811
  return {
809
812
  width: n.width * l.x,
810
813
  height: n.height * l.y,
@@ -812,10 +815,10 @@ function _e(t) {
812
815
  y: n.y * l.y - a.scrollTop * l.y + f.y + d.y
813
816
  };
814
817
  }
815
- function je(t) {
818
+ function Ke(t) {
816
819
  return Array.from(t.getClientRects());
817
820
  }
818
- function Ye(t) {
821
+ function Xe(t) {
819
822
  const e = T(t), n = ut(t), o = t.ownerDocument.body, r = W(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = W(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
820
823
  let s = -n.scrollLeft + Et(t);
821
824
  const c = -n.scrollTop;
@@ -826,7 +829,7 @@ function Ye(t) {
826
829
  y: c
827
830
  };
828
831
  }
829
- function qe(t, e) {
832
+ function Je(t, e) {
830
833
  const n = A(t), o = T(t), r = n.visualViewport;
831
834
  let i = o.clientWidth, s = o.clientHeight, c = 0, a = 0;
832
835
  if (r) {
@@ -841,7 +844,7 @@ function qe(t, e) {
841
844
  y: a
842
845
  };
843
846
  }
844
- function Ke(t, e) {
847
+ function Ge(t, e) {
845
848
  const n = M(t, !0, e === "fixed"), o = n.top + t.clientTop, r = n.left + t.clientLeft, i = L(t) ? $(t) : O(1), s = t.clientWidth * i.x, c = t.clientHeight * i.y, a = r * i.x, l = o * i.y;
846
849
  return {
847
850
  width: s,
@@ -850,16 +853,16 @@ function Ke(t, e) {
850
853
  y: l
851
854
  };
852
855
  }
853
- function Wt(t, e, n) {
856
+ function Dt(t, e, n) {
854
857
  let o;
855
858
  if (e === "viewport")
856
- o = qe(t, n);
859
+ o = Je(t, n);
857
860
  else if (e === "document")
858
- o = Ye(T(t));
861
+ o = Xe(T(t));
859
862
  else if (E(e))
860
- o = Ke(e, n);
863
+ o = Ge(e, n);
861
864
  else {
862
- const r = ee(t);
865
+ const r = oe(t);
863
866
  o = {
864
867
  x: e.x - r.x,
865
868
  y: e.y - r.y,
@@ -869,34 +872,34 @@ function Wt(t, e, n) {
869
872
  }
870
873
  return nt(o);
871
874
  }
872
- function oe(t, e) {
873
- const n = k(t);
874
- return n === e || !E(n) || z(n) ? !1 : R(n).position === "fixed" || oe(n, e);
875
+ function ie(t, e) {
876
+ const n = C(t);
877
+ return n === e || !E(n) || z(n) ? !1 : R(n).position === "fixed" || ie(n, e);
875
878
  }
876
- function Xe(t, e) {
879
+ function Qe(t, e) {
877
880
  const n = e.get(t);
878
881
  if (n)
879
882
  return n;
880
883
  let o = j(t, [], !1).filter((c) => E(c) && B(c) !== "body"), r = null;
881
884
  const i = R(t).position === "fixed";
882
- let s = i ? k(t) : t;
885
+ let s = i ? C(t) : t;
883
886
  for (; E(s) && !z(s); ) {
884
887
  const c = R(s), a = vt(s);
885
- !a && c.position === "fixed" && (r = null), (i ? !a && !r : !a && c.position === "static" && !!r && ["absolute", "fixed"].includes(r.position) || X(s) && !a && oe(t, s)) ? o = o.filter((f) => f !== s) : r = c, s = k(s);
888
+ !a && c.position === "fixed" && (r = null), (i ? !a && !r : !a && c.position === "static" && !!r && ["absolute", "fixed"].includes(r.position) || X(s) && !a && ie(t, s)) ? o = o.filter((f) => f !== s) : r = c, s = C(s);
886
889
  }
887
890
  return e.set(t, o), o;
888
891
  }
889
- function Je(t) {
892
+ function Ze(t) {
890
893
  let {
891
894
  element: e,
892
895
  boundary: n,
893
896
  rootBoundary: o,
894
897
  strategy: r
895
898
  } = t;
896
- const s = [...n === "clippingAncestors" ? at(e) ? [] : Xe(e, this._c) : [].concat(n), o], c = s[0], a = s.reduce((l, f) => {
897
- const u = Wt(e, f, r);
899
+ const s = [...n === "clippingAncestors" ? at(e) ? [] : Qe(e, this._c) : [].concat(n), o], c = s[0], a = s.reduce((l, f) => {
900
+ const u = Dt(e, f, r);
898
901
  return l.top = W(u.top, l.top), l.right = Z(u.right, l.right), l.bottom = Z(u.bottom, l.bottom), l.left = W(u.left, l.left), l;
899
- }, Wt(e, c, r));
902
+ }, Dt(e, c, r));
900
903
  return {
901
904
  width: a.right - a.left,
902
905
  height: a.bottom - a.top,
@@ -904,17 +907,17 @@ function Je(t) {
904
907
  y: a.top
905
908
  };
906
909
  }
907
- function Ge(t) {
910
+ function tn(t) {
908
911
  const {
909
912
  width: e,
910
913
  height: n
911
- } = te(t);
914
+ } = ne(t);
912
915
  return {
913
916
  width: e,
914
917
  height: n
915
918
  };
916
919
  }
917
- function Qe(t, e, n) {
920
+ function en(t, e, n) {
918
921
  const o = L(e), r = T(e), i = n === "fixed", s = M(t, !0, i, e);
919
922
  let c = {
920
923
  scrollLeft: 0,
@@ -926,7 +929,7 @@ function Qe(t, e, n) {
926
929
  const d = M(e, !0, i, e);
927
930
  a.x = d.x + e.clientLeft, a.y = d.y + e.clientTop;
928
931
  } else r && (a.x = Et(r));
929
- const l = r && !o && !i ? ne(r, c) : O(0), f = s.left + c.scrollLeft - a.x - l.x, u = s.top + c.scrollTop - a.y - l.y;
932
+ const l = r && !o && !i ? re(r, c) : O(0), f = s.left + c.scrollLeft - a.x - l.x, u = s.top + c.scrollTop - a.y - l.y;
930
933
  return {
931
934
  x: f,
932
935
  y: u,
@@ -937,7 +940,7 @@ function Qe(t, e, n) {
937
940
  function ht(t) {
938
941
  return R(t).position === "static";
939
942
  }
940
- function Dt(t, e) {
943
+ function Ft(t, e) {
941
944
  if (!L(t) || R(t).position === "fixed")
942
945
  return null;
943
946
  if (e)
@@ -945,28 +948,28 @@ function Dt(t, e) {
945
948
  let n = t.offsetParent;
946
949
  return T(t) === n && (n = n.ownerDocument.body), n;
947
950
  }
948
- function re(t, e) {
951
+ function se(t, e) {
949
952
  const n = A(t);
950
953
  if (at(t))
951
954
  return n;
952
955
  if (!L(t)) {
953
- let r = k(t);
956
+ let r = C(t);
954
957
  for (; r && !z(r); ) {
955
958
  if (E(r) && !ht(r))
956
959
  return r;
957
- r = k(r);
960
+ r = C(r);
958
961
  }
959
962
  return n;
960
963
  }
961
- let o = Dt(t, e);
962
- for (; o && ze(o) && ht(o); )
963
- o = Dt(o, e);
964
- return o && z(o) && ht(o) && !vt(o) ? n : o || Be(t) || n;
964
+ let o = Ft(t, e);
965
+ for (; o && Ie(o) && ht(o); )
966
+ o = Ft(o, e);
967
+ return o && z(o) && ht(o) && !vt(o) ? n : o || _e(t) || n;
965
968
  }
966
- const Ze = async function(t) {
967
- const e = this.getOffsetParent || re, n = this.getDimensions, o = await n(t.floating);
969
+ const nn = async function(t) {
970
+ const e = this.getOffsetParent || se, n = this.getDimensions, o = await n(t.floating);
968
971
  return {
969
- reference: Qe(t.reference, await e(t.floating), t.strategy),
972
+ reference: en(t.reference, await e(t.floating), t.strategy),
970
973
  floating: {
971
974
  x: 0,
972
975
  y: 0,
@@ -975,22 +978,22 @@ const Ze = async function(t) {
975
978
  }
976
979
  };
977
980
  };
978
- function tn(t) {
981
+ function on(t) {
979
982
  return R(t).direction === "rtl";
980
983
  }
981
- const en = {
982
- convertOffsetParentRelativeRectToViewportRelativeRect: _e,
984
+ const rn = {
985
+ convertOffsetParentRelativeRectToViewportRelativeRect: qe,
983
986
  getDocumentElement: T,
984
- getClippingRect: Je,
985
- getOffsetParent: re,
986
- getElementRects: Ze,
987
- getClientRects: je,
988
- getDimensions: Ge,
987
+ getClippingRect: Ze,
988
+ getOffsetParent: se,
989
+ getElementRects: nn,
990
+ getClientRects: Ke,
991
+ getDimensions: tn,
989
992
  getScale: $,
990
993
  isElement: E,
991
- isRTL: tn
994
+ isRTL: on
992
995
  };
993
- function nn(t, e) {
996
+ function sn(t, e) {
994
997
  let n = null, o;
995
998
  const r = T(t);
996
999
  function i() {
@@ -1036,7 +1039,7 @@ function nn(t, e) {
1036
1039
  }
1037
1040
  return s(!0), i;
1038
1041
  }
1039
- function on(t, e, n, o) {
1042
+ function cn(t, e, n, o) {
1040
1043
  o === void 0 && (o = {});
1041
1044
  const {
1042
1045
  ancestorScroll: r = !0,
@@ -1050,7 +1053,7 @@ function on(t, e, n, o) {
1050
1053
  passive: !0
1051
1054
  }), i && m.addEventListener("resize", n);
1052
1055
  });
1053
- const u = l && c ? nn(l, n) : null;
1056
+ const u = l && c ? sn(l, n) : null;
1054
1057
  let d = -1, h = null;
1055
1058
  s && (h = new ResizeObserver((m) => {
1056
1059
  let [w] = m;
@@ -1072,41 +1075,41 @@ function on(t, e, n, o) {
1072
1075
  }), u == null || u(), (m = h) == null || m.disconnect(), h = null, a && cancelAnimationFrame(p);
1073
1076
  };
1074
1077
  }
1075
- const rn = $e, sn = He, Ft = Ne, cn = (t, e, n) => {
1078
+ const ln = Be, an = Ue, Mt = He, un = (t, e, n) => {
1076
1079
  const o = /* @__PURE__ */ new Map(), r = {
1077
- platform: en,
1080
+ platform: rn,
1078
1081
  ...n
1079
1082
  }, i = {
1080
1083
  ...r.platform,
1081
1084
  _c: o
1082
1085
  };
1083
- return Me(t, e, {
1086
+ return $e(t, e, {
1084
1087
  ...r,
1085
1088
  platform: i
1086
1089
  });
1087
- }, Ln = ({
1090
+ }, Pn = ({
1088
1091
  content: t,
1089
1092
  open: e,
1090
1093
  placement: n,
1091
1094
  offset: { mainAxis: o, crossAxis: r } = { mainAxis: 0, crossAxis: 0 }
1092
1095
  }) => yt((i) => {
1093
1096
  const s = it.toSignal(e), c = i.element;
1094
- return fe(
1097
+ return pe(
1095
1098
  s,
1096
- () => jt(
1099
+ () => Yt(
1097
1100
  "body",
1098
- Bt.div(
1101
+ Ut.div(
1099
1102
  K((a) => {
1100
1103
  const l = a;
1101
- return l.style.position = "absolute", on(c, l, () => {
1102
- cn(c, l, {
1104
+ return l.style.position = "absolute", cn(c, l, () => {
1105
+ un(c, l, {
1103
1106
  placement: n,
1104
1107
  strategy: "absolute",
1105
1108
  middleware: [
1106
- Ft(),
1107
- rn({ mainAxis: o, crossAxis: r }),
1108
- sn(),
1109
- Ft()
1109
+ Mt(),
1110
+ ln({ mainAxis: o, crossAxis: r }),
1111
+ an(),
1112
+ Mt()
1110
1113
  ]
1111
1114
  }).then(({ x: f, y: u }) => {
1112
1115
  l.style.top = `${u}px`, l.style.left = `${f}px`;
@@ -1117,21 +1120,21 @@ const rn = $e, sn = He, Ft = Ne, cn = (t, e, n) => {
1117
1120
  )
1118
1121
  )
1119
1122
  )(i);
1120
- }), ln = (t, e) => {
1123
+ }), fn = (t, e) => {
1121
1124
  if (typeof e == "function")
1122
- return ln(t, { success: e });
1125
+ return fn(t, { success: e });
1123
1126
  const n = e.failure ?? ((r) => q(
1124
1127
  xt(r.on(console.error)),
1125
1128
  r.map((i) => `Error: ${i}`)
1126
1129
  )), o = e.success;
1127
- return _t(it.toSignal(t), {
1130
+ return jt(it.toSignal(t), {
1128
1131
  Success: (r) => o(r.$.value),
1129
1132
  Failure: (r) => n(r.$.error)
1130
1133
  });
1131
- }, Tn = () => Ut.focus((t) => {
1134
+ }, Wn = () => It.focus((t) => {
1132
1135
  var e;
1133
1136
  return (e = t.target) == null ? void 0 : e.select();
1134
- }), Sn = (t) => yt((e) => {
1137
+ }), Dn = (t) => yt((e) => {
1135
1138
  const { element: n } = e, o = D({
1136
1139
  width: n.clientWidth,
1137
1140
  height: n.clientHeight
@@ -1142,7 +1145,7 @@ const rn = $e, sn = He, Ft = Ne, cn = (t, e, n) => {
1142
1145
  return typeof ResizeObserver == "function" && (s = new ResizeObserver(i), s.observe(n)), (c) => {
1143
1146
  s == null || s.disconnect(), r(c);
1144
1147
  };
1145
- }), Cn = (t) => (e) => {
1148
+ }), Fn = (t) => (e) => {
1146
1149
  const n = wt(), o = D({
1147
1150
  width: (n == null ? void 0 : n.innerWidth) ?? 0,
1148
1151
  height: (n == null ? void 0 : n.innerHeight) ?? 0
@@ -1155,7 +1158,7 @@ const rn = $e, sn = He, Ft = Ne, cn = (t, e, n) => {
1155
1158
  return n == null || n.addEventListener("resize", i), (s) => {
1156
1159
  n == null || n.removeEventListener("resize", i), r(s);
1157
1160
  };
1158
- }, an = (t, e) => {
1161
+ }, hn = (t, e) => {
1159
1162
  const n = e.split("/").filter((r) => r !== ""), o = {};
1160
1163
  for (let r = 0; r < t.length; r++) {
1161
1164
  const i = t[r], s = n[r];
@@ -1170,22 +1173,22 @@ const rn = $e, sn = He, Ft = Ne, cn = (t, e, n) => {
1170
1173
  return { params: o, path: e };
1171
1174
  }
1172
1175
  return n.length !== t.length ? null : { params: o, path: e };
1173
- }, un = (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 !== ""), fn = (t) => {
1176
+ }, dn = (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 !== ""), mn = (t) => {
1174
1177
  const e = t.map((n) => {
1175
- const o = un(n);
1178
+ const o = dn(n);
1176
1179
  return { route: n, segments: o };
1177
1180
  });
1178
1181
  return function(o) {
1179
1182
  for (const { segments: r, route: i } of e) {
1180
- const s = an(r, o);
1183
+ const s = hn(r, o);
1181
1184
  if (s)
1182
1185
  return { ...s, route: i };
1183
1186
  }
1184
1187
  return null;
1185
1188
  };
1186
- }, kn = (t) => {
1187
- const e = fn(Object.keys(t));
1188
- return Yt((n) => {
1189
+ }, Mn = (t) => {
1190
+ const e = mn(Object.keys(t));
1191
+ return Kt((n) => {
1189
1192
  const o = n.map((r) => {
1190
1193
  const i = e(r.pathname);
1191
1194
  if (i == null)
@@ -1198,13 +1201,13 @@ const rn = $e, sn = He, Ft = Ne, cn = (t, e, n) => {
1198
1201
  hash: r.hash
1199
1202
  };
1200
1203
  });
1201
- return he(
1204
+ return ge(
1202
1205
  o.map((r) => [r.route, r]),
1203
1206
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1204
1207
  t
1205
1208
  );
1206
1209
  });
1207
- }, ot = 60 * 1e3, gt = 60 * ot, Y = 24 * gt, Mt = 7 * Y, Nt = 30 * Y, hn = 365 * Y, dn = [
1210
+ }, ot = 60 * 1e3, gt = 60 * ot, Y = 24 * gt, Nt = 7 * Y, Vt = 30 * Y, pn = 365 * Y, gn = [
1208
1211
  {
1209
1212
  max: ot * 90,
1210
1213
  value: ot,
@@ -1227,28 +1230,28 @@ const rn = $e, sn = He, Ft = Ne, cn = (t, e, n) => {
1227
1230
  future: { singular: "tomorrow", plural: "in {} days" }
1228
1231
  },
1229
1232
  {
1230
- max: Mt * 6,
1231
- value: Mt,
1233
+ max: Nt * 6,
1234
+ value: Nt,
1232
1235
  name: "week",
1233
1236
  past: { singular: "last week", plural: "{} weeks ago" },
1234
1237
  future: { singular: "in a week", plural: "in {} weeks" }
1235
1238
  },
1236
1239
  {
1237
- max: Nt * 18,
1238
- value: Nt,
1240
+ max: Vt * 18,
1241
+ value: Vt,
1239
1242
  name: "month",
1240
1243
  past: { singular: "last month", plural: "{} months ago" },
1241
1244
  future: { singular: "in a month", plural: "in {} months" }
1242
1245
  },
1243
1246
  {
1244
1247
  max: 1 / 0,
1245
- value: hn,
1248
+ value: pn,
1246
1249
  name: "year",
1247
1250
  past: { singular: "last year", plural: "{} years ago" },
1248
1251
  future: { singular: "in a year", plural: "in {} years" }
1249
1252
  }
1250
1253
  ];
1251
- function Vt(t, e, n, o) {
1254
+ function $t(t, e, n, o) {
1252
1255
  const r = Math.round(t / e);
1253
1256
  return r <= 1 ? n : o.replace(
1254
1257
  "{}",
@@ -1258,58 +1261,67 @@ function Vt(t, e, n, o) {
1258
1261
  })
1259
1262
  );
1260
1263
  }
1261
- function mn(t) {
1264
+ function yn(t) {
1262
1265
  const e = Math.abs(t);
1263
1266
  if (e < ot)
1264
1267
  return t < 0 ? "just now" : "in a moment";
1265
- for (const n of dn)
1268
+ for (const n of gn)
1266
1269
  if (e < n.max)
1267
- return t < 0 ? Vt(e, n.value, n.past.singular, n.past.plural) : Vt(e, n.value, n.future.singular, n.future.plural);
1270
+ return t < 0 ? $t(e, n.value, n.past.singular, n.past.plural) : $t(e, n.value, n.future.singular, n.future.plural);
1268
1271
  throw new Error("unreachable");
1269
1272
  }
1270
- const Pn = (t, e) => {
1271
- const n = e != null ? zt.is(e) ? e.derive() : D(e) : D(/* @__PURE__ */ new Date()), o = de(
1273
+ const Nn = (t, e) => {
1274
+ const n = e != null ? Bt.is(e) ? e.derive() : D(e) : D(/* @__PURE__ */ new Date()), o = ye(
1272
1275
  t,
1273
1276
  n
1274
1277
  )((i, s) => {
1275
1278
  const c = i.getTime() - s.getTime();
1276
- return mn(c);
1277
- }), r = me.is(n) ? setInterval(() => n.set(/* @__PURE__ */ new Date()), 5e3) : void 0;
1279
+ return yn(c);
1280
+ }), r = qt.is(n) ? setInterval(() => n.set(/* @__PURE__ */ new Date()), 5e3) : void 0;
1278
1281
  return o.onDispose(() => {
1279
1282
  r != null && clearInterval(r), n.dispose();
1280
1283
  }), o;
1281
1284
  };
1285
+ class wn extends qt {
1286
+ constructor() {
1287
+ super(...arguments);
1288
+ kt(this, "tick", () => this.update((n) => n + 1));
1289
+ }
1290
+ }
1291
+ const Vn = (t = 0) => new wn(t, (e, n) => e === n);
1282
1292
  export {
1283
- Ae as Anchor,
1284
- Ee as AsyncResultView,
1285
- bn as AutoFocus,
1286
- An as AutoSelect,
1287
- Sn as ElementSize,
1288
- Rn as HTMLTitle,
1289
- En as HiddenWhenEmpty,
1290
- Le as InViewport,
1291
- xe as LocationProviderMarker,
1292
- Ln as PopOver,
1293
- xn as ProvideAppearance,
1294
- gn as ProvideLocation,
1295
- ln as ResultView,
1296
- kn as Router,
1297
- Tn as SelectOnFocus,
1298
- vn as UseAppearance,
1299
- Yt as UseLocation,
1300
- On as WhenInViewport,
1301
- Cn as WindowSize,
1302
- ge as _checkExtensionCondition,
1303
- pe as _getExtension,
1304
- fn as _makeRouteMatcher,
1305
- un as _parseRouteSegments,
1306
- qt as appearanceMarker,
1307
- yn as areLocationsEqual,
1308
- we as handleAnchorClick,
1309
- ve as locationFromURL,
1310
- Pn as makeRelativeTime,
1311
- an as matchesRoute,
1312
- be as setLocationFromUrl,
1313
- mn as timeDiffToString,
1314
- wn as urlFromLocation
1293
+ Oe as Anchor,
1294
+ Le as AsyncResultView,
1295
+ Ln as AutoFocus,
1296
+ Tn as AutoSelect,
1297
+ Dn as ElementSize,
1298
+ Sn as HTMLTitle,
1299
+ kn as HiddenWhenEmpty,
1300
+ Se as InViewport,
1301
+ Ae as LocationProviderMarker,
1302
+ Pn as PopOver,
1303
+ Rn as ProvideAppearance,
1304
+ bn as ProvideLocation,
1305
+ fn as ResultView,
1306
+ Mn as Router,
1307
+ Wn as SelectOnFocus,
1308
+ wn as Ticker,
1309
+ On as UseAppearance,
1310
+ Kt as UseLocation,
1311
+ Cn as WhenInViewport,
1312
+ Fn as WindowSize,
1313
+ xe as _checkExtensionCondition,
1314
+ we as _getExtension,
1315
+ mn as _makeRouteMatcher,
1316
+ dn as _parseRouteSegments,
1317
+ Xt as appearanceMarker,
1318
+ An as areLocationsEqual,
1319
+ be as handleAnchorClick,
1320
+ Ee as locationFromURL,
1321
+ Nn as makeRelativeTime,
1322
+ Vn as makeTicker,
1323
+ hn as matchesRoute,
1324
+ Re as setLocationFromUrl,
1325
+ yn as timeDiffToString,
1326
+ En as urlFromLocation
1315
1327
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/ui",
3
- "version": "0.23.0-next.16",
3
+ "version": "0.23.0-next.17",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -0,0 +1,5 @@
1
+ import { Prop } from '@tempots/dom';
2
+ export declare class Ticker extends Prop<number> {
3
+ readonly tick: () => void;
4
+ }
5
+ export declare const makeTicker: (initial?: number) => Ticker;