@tempots/ui 0.23.0-next.8 → 0.23.0-next.9
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 +1 -1
- package/index.js +313 -288
- package/package.json +2 -2
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tempots/dom"),Tt=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const n=e.split(".")||[];return n.length>1?"."+n.pop():void 0},St=(t,e)=>{const n=Tt(e);return n!=null&&(t.length===0||!t.some(o=>n==o))},ee=(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,f=i.getAttribute("href");if(!(f!=null&&f.startsWith("#"))&&f!==l)return!0}return e?!1:St(n,s)},Ct=(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=>{ee(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},Pt=u.makeProviderMark("LocationProvider"),ne=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))),ut=t=>u.UseProvider(Pt,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)}}),oe=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,Ft=(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}},Wt=(t,e)=>{const n=Ft(e);return t.set(n),t},re=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},Dt=(t,...e)=>{if(typeof t=="string"||u.Signal.is(t))return Dt({href:t},...e);const{href:n,...o}=t;return ut(r=>u.html.a(u.on.click(Ct(()=>(Wt(r,u.Value.get(n)),!0),o)),u.attr.href(n),...e))},ft=u.makeProviderMark("Appearance"),ie=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(ft,o,t),u.OnDispose(()=>i==null?void 0:i.removeEventListener("change",r)))},se=t=>u.UseProvider(ft,t),Mt=(t,e)=>{if(typeof e=="function")return Mt(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})},ce=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.focus()},t);return()=>clearTimeout(n)}),le=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.select()},t);return()=>clearTimeout(n)}),ae=u.OnElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),n=>{n&&t.style.setProperty(":empty",e)}}),ue=t=>u.Portal("head > title",u.attr.innerText(t)),fe={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 me(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)})},fe[t])),I[t]}const Vt=(t,e)=>{const n=u.makeProp(!1);return u.Fragment(u.OnElement(o=>{const r=typeof IntersectionObserver<"u"?me(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)))},he=(t,e,n)=>Vt(t,o=>u.When(o,e,n??u.Empty)),G=Math.min,W=Math.max,Q=Math.round,K=Math.floor,C=t=>({x:t,y:t}),de={left:"right",right:"left",bottom:"top",top:"bottom"},pe={start:"end",end:"start"};function vt(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 Nt(t){return t==="x"?"y":"x"}function Ht(t){return t==="y"?"height":"width"}function $(t){return["top","bottom"].includes(D(t))?"y":"x"}function $t(t){return Nt($(t))}function ge(t,e,n){n===void 0&&(n=!1);const o=ot(t),r=$t(t),i=Ht(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 ye(t){const e=Z(t);return[lt(t),e,lt(e)]}function lt(t){return t.replace(/start|end/g,e=>pe[e])}function we(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 ve(t,e,n,o){const r=ot(t);let i=we(D(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(lt)))),i}function Z(t){return t.replace(/left|right|bottom|top/g,e=>de[e])}function xe(t){return{top:0,right:0,bottom:0,left:0,...t}}function be(t){return typeof t!="number"?xe(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 xt(t,e,n){let{reference:o,floating:r}=t;const i=$(e),s=$t(e),c=Ht(s),a=D(e),l=i==="y",f=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,p=o[c]/2-r[c]/2;let h;switch(a){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:m};break;case"left":h={x:o.x-r.width,y:m};break;default:h={x:o.x,y:o.y}}switch(ot(e)){case"start":h[s]-=p*(n&&l?-1:1);break;case"end":h[s]+=p*(n&&l?-1:1);break}return h}const Ae=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:f,y:m}=xt(l,o,a),p=o,h={},g=0;for(let y=0;y<c.length;y++){const{name:w,fn:d}=c[y],{x:v,y:x,data:A,reset:b}=await d({x:f,y:m,initialPlacement:o,placement:p,strategy:r,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});f=v??f,m=x??m,h={...h,[w]:{...h[w],...A}},b&&g<=50&&(g++,typeof b=="object"&&(b.placement&&(p=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):b.rects),{x:f,y:m}=xt(l,p,a)),y=-1)}return{x:f,y:m,placement:p,strategy:r,middlewareData:h}};async function zt(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:f="viewport",elementContext:m="floating",altBoundary:p=!1,padding:h=0}=nt(e,t),g=be(h),w=c[p?m==="floating"?"reference":"floating":m],d=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:f,strategy:a})),v=m==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),A=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},b=tt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:x,strategy:a}):v);return{top:(d.top-b.top+g.top)/A.y,bottom:(b.bottom-d.bottom+g.bottom)/A.y,left:(d.left-b.left+g.left)/A.x,right:(b.right-d.right+g.right)/A.x}}const Ee=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:f=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=nt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const d=D(r),v=$(c),x=D(c)===c,A=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=p||(x||!y?[Z(c)]:ye(c)),V=g!=="none";!p&&V&&b.push(...ve(c,y,g,A));const Zt=[c,...b],st=await zt(e,w),X=[];let B=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&X.push(st[d]),m){const F=ge(r,s,A);X.push(st[F[0]],st[F[1]])}if(B=[...B,{placement:r,overflows:X}],!X.every(F=>F<=0)){var pt,gt;const F=(((pt=i.flip)==null?void 0:pt.index)||0)+1,wt=Zt[F];if(wt)return{data:{index:F,overflows:B},reset:{placement:wt}};let _=(gt=B.filter(N=>N.overflows[0]<=0).sort((N,T)=>N.overflows[1]-T.overflows[1])[0])==null?void 0:gt.placement;if(!_)switch(h){case"bestFit":{var yt;const N=(yt=B.filter(T=>{if(V){const S=$(T.placement);return S===v||S==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(S=>S>0).reduce((S,te)=>S+te,0)]).sort((T,S)=>T[1]-S[1])[0])==null?void 0:yt[0];N&&(_=N);break}case"initialPlacement":_=c;break}if(r!==_)return{reset:{placement:_}}}return{}}}};async function Oe(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,f=i&&a?-1:1,m=nt(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),a?{x:h*f,y:p*l}:{x:p*l,y:h*f}}const Re=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 Oe(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}}}}},Le=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:d,y:v}=w;return{x:d,y:v}}},...a}=nt(t,e),l={x:n,y:o},f=await zt(e,a),m=$(D(r)),p=Nt(m);let h=l[p],g=l[m];if(i){const w=p==="y"?"top":"left",d=p==="y"?"bottom":"right",v=h+f[w],x=h-f[d];h=vt(v,h,x)}if(s){const w=m==="y"?"top":"left",d=m==="y"?"bottom":"right",v=g+f[w],x=g-f[d];g=vt(v,g,x)}const y=c.fn({...e,[p]:h,[m]:g});return{...y,data:{x:y.x-n,y:y.y-o}}}}};function U(t){return Ut(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=(Ut(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ut(t){return t instanceof Node||t instanceof E(t).Node}function R(t){return t instanceof Element||t instanceof E(t).Element}function L(t){return t instanceof HTMLElement||t instanceof E(t).HTMLElement}function bt(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function Y(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=O(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function ke(t){return["table","td","th"].includes(U(t))}function rt(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function mt(t){const e=ht(),n=O(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 Te(t){let e=P(t);for(;L(e)&&!z(e);){if(rt(e))return null;if(mt(e))return e;e=P(e)}return null}function ht(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(U(t))}function O(t){return E(t).getComputedStyle(t)}function it(t){return R(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function P(t){if(U(t)==="html")return t;const e=t.assignedSlot||t.parentNode||bt(t)&&t.host||k(t);return bt(e)?e.host:e}function Bt(t){const e=P(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:L(e)&&Y(e)?e:Bt(e)}function j(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Bt(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=E(r);return i?e.concat(s,s.visualViewport||[],Y(r)?r:[],s.frameElement&&n?j(s.frameElement):[]):e.concat(r,j(r,[],n))}function _t(t){const e=O(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=L(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 dt(t){return R(t)?t:t.contextElement}function H(t){const e=dt(t);if(!L(e))return C(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=_t(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 Se=C(0);function It(t){const e=E(t);return!ht()||!e.visualViewport?Se:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ce(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=dt(t);let s=C(1);e&&(o?R(o)&&(s=H(o)):s=H(t));const c=Ce(i,n,o)?It(i):C(0);let a=(r.left+c.x)/s.x,l=(r.top+c.y)/s.y,f=r.width/s.x,m=r.height/s.y;if(i){const p=E(i),h=o&&R(o)?E(o):o;let g=p,y=g.frameElement;for(;y&&o&&h!==g;){const w=H(y),d=y.getBoundingClientRect(),v=O(y),x=d.left+(y.clientLeft+parseFloat(v.paddingLeft))*w.x,A=d.top+(y.clientTop+parseFloat(v.paddingTop))*w.y;a*=w.x,l*=w.y,f*=w.x,m*=w.y,a+=x,l+=A,g=E(y),y=g.frameElement}}return tt({width:f,height:m,x:a,y:l})}function Pe(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=k(o),c=e?rt(e.floating):!1;if(o===s||c&&i)return n;let a={scrollLeft:0,scrollTop:0},l=C(1);const f=C(0),m=L(o);if((m||!m&&!i)&&((U(o)!=="body"||Y(s))&&(a=it(o)),L(o))){const p=M(o);l=H(o),f.x=p.x+o.clientLeft,f.y=p.y+o.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+f.x,y:n.y*l.y-a.scrollTop*l.y+f.y}}function Fe(t){return Array.from(t.getClientRects())}function jt(t){return M(k(t)).left+it(t).scrollLeft}function We(t){const e=k(t),n=it(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+jt(t);const c=-n.scrollTop;return O(o).direction==="rtl"&&(s+=W(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}function De(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=ht();(!l||l&&e==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:s,x:c,y:a}}function Me(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=L(t)?H(t):C(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 At(t,e,n){let o;if(e==="viewport")o=De(t,n);else if(e==="document")o=We(k(t));else if(R(e))o=Me(e,n);else{const r=It(t);o={...e,x:e.x-r.x,y:e.y-r.y}}return tt(o)}function qt(t,e){const n=P(t);return n===e||!R(n)||z(n)?!1:O(n).position==="fixed"||qt(n,e)}function Ve(t,e){const n=e.get(t);if(n)return n;let o=j(t,[],!1).filter(c=>R(c)&&U(c)!=="body"),r=null;const i=O(t).position==="fixed";let s=i?P(t):t;for(;R(s)&&!z(s);){const c=O(s),a=mt(s);!a&&c.position==="fixed"&&(r=null),(i?!a&&!r:!a&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Y(s)&&!a&&qt(t,s))?o=o.filter(f=>f!==s):r=c,s=P(s)}return e.set(t,o),o}function Ne(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?rt(e)?[]:Ve(e,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,f)=>{const m=At(e,f,r);return l.top=W(m.top,l.top),l.right=G(m.right,l.right),l.bottom=G(m.bottom,l.bottom),l.left=W(m.left,l.left),l},At(e,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function He(t){const{width:e,height:n}=_t(t);return{width:e,height:n}}function $e(t,e,n){const o=L(e),r=k(e),i=n==="fixed",s=M(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const a=C(0);if(o||!o&&!i)if((U(e)!=="body"||Y(r))&&(c=it(e)),o){const m=M(e,!0,i,e);a.x=m.x+e.clientLeft,a.y=m.y+e.clientTop}else r&&(a.x=jt(r));const l=s.left+c.scrollLeft-a.x,f=s.top+c.scrollTop-a.y;return{x:l,y:f,width:s.width,height:s.height}}function ct(t){return O(t).position==="static"}function Et(t,e){return!L(t)||O(t).position==="fixed"?null:e?e(t):t.offsetParent}function Yt(t,e){const n=E(t);if(rt(t))return n;if(!L(t)){let r=P(t);for(;r&&!z(r);){if(R(r)&&!ct(r))return r;r=P(r)}return n}let o=Et(t,e);for(;o&&ke(o)&&ct(o);)o=Et(o,e);return o&&z(o)&&ct(o)&&!mt(o)?n:o||Te(t)||n}const ze=async function(t){const e=this.getOffsetParent||Yt,n=this.getDimensions,o=await n(t.floating);return{reference:$e(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ue(t){return O(t).direction==="rtl"}const Be={convertOffsetParentRelativeRectToViewportRelativeRect:Pe,getDocumentElement:k,getClippingRect:Ne,getOffsetParent:Yt,getElementRects:ze,getClientRects:Fe,getDimensions:He,getScale:H,isElement:R,isRTL:Ue};function _e(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:f,width:m,height:p}=t.getBoundingClientRect();if(c||e(),!m||!p)return;const h=K(f),g=K(r.clientWidth-(l+m)),y=K(r.clientHeight-(f+p)),w=K(l),v={rootMargin:-h+"px "+-g+"px "+-y+"px "+-w+"px",threshold:W(0,G(1,a))||1};let x=!0;function A(b){const V=b[0].intersectionRatio;if(V!==a){if(!x)return s();V?s(!1,V):o=setTimeout(()=>{s(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(A,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,v)}n.observe(t)}return s(!0),i}function Ie(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=dt(t),f=r||i?[...l?j(l):[],...j(e)]:[];f.forEach(d=>{r&&d.addEventListener("scroll",n,{passive:!0}),i&&d.addEventListener("resize",n)});const m=l&&c?_e(l,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(d=>{let[v]=d;v&&v.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(e)})),n()}),l&&!a&&h.observe(l),h.observe(e));let g,y=a?M(t):null;a&&w();function w(){const d=M(t);y&&(d.x!==y.x||d.y!==y.y||d.width!==y.width||d.height!==y.height)&&n(),y=d,g=requestAnimationFrame(w)}return n(),()=>{var d;f.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),m==null||m(),(d=h)==null||d.disconnect(),h=null,a&&cancelAnimationFrame(g)}}const je=Re,qe=Le,Ot=Ee,Ye=(t,e,n)=>{const o=new Map,r={platform:Be,...n},i={...r.platform,_c:o};return Ae(t,e,{...r,platform:i})},Xe=({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.When(s,u.Portal("body",u.html.div(u.OnElement(a=>{const l=a;return l.style.position="absolute",Ie(c,l,()=>{Ye(c,l,{placement:n,strategy:"absolute",middleware:[Ot(),je({mainAxis:o,crossAxis:r}),qe(),Ot()]}).then(({x:f,y:m})=>{l.style.top=`${m}px`,l.style.left=`${f}px`})})}),t())))(i)}),Xt=(t,e)=>{if(typeof e=="function")return Xt(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)})},Ke=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),Je=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)}}),Ge=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)}},Kt=(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}},Jt=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!==""),Gt=t=>{const e=t.map(n=>{const o=Jt(n);return{route:n,segments:o}});return function(o){for(const{segments:r,route:i}of e){const s=Kt(r,o);if(s)return{...s,route:i}}return null}},Qe=t=>{const e=Gt(Object.keys(t));return ut(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,at=60*et,q=24*at,Rt=7*q,Lt=30*q,Ze=365*q,tn=[{max:et*90,value:et,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:at*36,value:at,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:Rt*6,value:Rt,name:"week",past:{singular:"last week",plural:"{} weeks ago"},future:{singular:"in a week",plural:"in {} weeks"}},{max:Lt*18,value:Lt,name:"month",past:{singular:"last month",plural:"{} months ago"},future:{singular:"in a month",plural:"in {} months"}},{max:1/0,value:Ze,name:"year",past:{singular:"last year",plural:"{} years ago"},future:{singular:"in a year",plural:"in {} years"}}];function kt(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 Qt(t){const e=Math.abs(t);if(e<et)return t<0?"just now":"in a moment";for(const n of tn)if(e<n.max)return t<0?kt(e,n.value,n.past.singular,n.past.plural):kt(e,n.value,n.future.singular,n.future.plural);throw new Error("unreachable")}const en=(t,e)=>{const n=e!=null?u.Signal.is(e)?e.map(i=>i):u.makeProp(e):u.makeProp(new Date),o=u.makeComputedOf(t,n)((i,s)=>{const c=i.getTime()-s.getTime();return Qt(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=Dt;exports.AsyncResultView=Mt;exports.AutoFocus=ce;exports.AutoSelect=le;exports.ElementSize=Je;exports.HTMLTitle=ue;exports.HiddenWhenEmpty=ae;exports.InViewport=Vt;exports.LocationProviderMarker=Pt;exports.PopOver=Xe;exports.ProvideAppearance=ie;exports.ProvideLocation=ne;exports.ResultView=Xt;exports.Router=Qe;exports.SelectOnFocus=Ke;exports.UseAppearance=se;exports.UseLocation=ut;exports.WhenInViewport=he;exports.WindowSize=Ge;exports._checkExtensionCondition=St;exports._getExtension=Tt;exports._makeRouteMatcher=Gt;exports._parseRouteSegments=Jt;exports.appearanceMarker=ft;exports.areLocationsEqual=oe;exports.handleAnchorClick=Ct;exports.locationFromURL=Ft;exports.makeRelativeTime=en;exports.matchesRoute=Kt;exports.setLocationFromUrl=Wt;exports.timeDiffToString=Qt;exports.urlFromLocation=re;
|
|
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))},oe=(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,f=i.getAttribute("href");if(!(f!=null&&f.startsWith("#"))&&f!==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=>{oe(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},Dt=u.makeProviderMark("LocationProvider"),re=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))),dt=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)}}),ie=(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},se=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 dt(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"),ce=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)))},le=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})},ae=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.focus()},t);return()=>clearTimeout(n)}),ue=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.select()},t);return()=>clearTimeout(n)}),fe=u.OnElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),n=>{n&&t.style.setProperty(":empty",e)}}),me=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 he(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"?he(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)))},pe=(t,e,n)=>$t(t,o=>u.When(o,e,n??u.Empty)),G=Math.min,W=Math.max,Q=Math.round,K=Math.floor,P=t=>({x:t,y:t}),ge={left:"right",right:"left",bottom:"top",top:"bottom"},ye={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 we(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 xe(t){const e=Z(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>ye[e])}function ve(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 be(t,e,n,o){const r=ot(t);let i=ve(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=>ge[e])}function Ae(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ee(t){return typeof t!="number"?Ae(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",f=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,h=o[c]/2-r[c]/2;let d;switch(a){case"top":d={x:f,y:o.y-r.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:m};break;case"left":d={x:o.x-r.width,y:m};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 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:f,y:m}=Et(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:f,y:m,initialPlacement:o,placement:h,strategy:r,middlewareData:d,rects:l,platform:s,elements:{reference:t,floating:e}});f=x??f,m=v??m,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:f,y:m}=Et(l,h,a)),y=-1)}return{x:f,y:m,placement:h,strategy:r,middlewareData:d}};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:f="viewport",elementContext:m="floating",altBoundary:h=!1,padding:d=0}=nt(e,t),g=Ee(d),w=c[h?m==="floating"?"reference":"floating":m],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:f,strategy:a})),x=m==="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 Oe=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:f=!0,crossAxis:m=!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)]:xe(c)),V=g!=="none";!h&&V&&b.push(...be(c,y,g,A));const ee=[c,...b],ct=await _t(e,w),X=[];let U=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&X.push(ct[p]),m){const F=we(r,s,A);X.push(ct[F[0]],ct[F[1]])}if(U=[...U,{placement:r,overflows:X}],!X.every(F=>F<=0)){var wt,xt;const F=(((wt=i.flip)==null?void 0:wt.index)||0)+1,bt=ee[F];if(bt)return{data:{index:F,overflows:U},reset:{placement:bt}};let _=(xt=U.filter(N=>N.overflows[0]<=0).sort((N,k)=>N.overflows[1]-k.overflows[1])[0])==null?void 0:xt.placement;if(!_)switch(d){case"bestFit":{var vt;const N=(vt=U.filter(k=>{if(V){const S=$(k.placement);return S===x||S==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(S=>S>0).reduce((S,ne)=>S+ne,0)]).sort((k,S)=>k[1]-S[1])[0])==null?void 0:vt[0];N&&(_=N);break}case"initialPlacement":_=c;break}if(r!==_)return{reset:{placement:_}}}return{}}}};async function Le(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,f=i&&a?-1:1,m=nt(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:g}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof g=="number"&&(d=c==="end"?g*-1:g),a?{x:d*f,y:h*l}:{x:h*l,y:d*f}}const Te=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 Le(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}}}}},ke=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},f=await _t(e,a),m=$(D(r)),h=zt(m);let d=l[h],g=l[m];if(i){const w=h==="y"?"top":"left",p=h==="y"?"bottom":"right",x=d+f[w],v=d-f[p];d=At(x,d,v)}if(s){const w=m==="y"?"top":"left",p=m==="y"?"bottom":"right",x=g+f[w],v=g-f[p];g=At(x,g,v)}const y=c.fn({...e,[h]:d,[m]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[h]:i,[m]: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 T(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 R(t){return rt()?t instanceof Element||t instanceof E(t).Element:!1}function L(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}=O(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function Se(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 pt(t){const e=gt(),n=R(t)?O(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 Pe(t){let e=C(t);for(;L(e)&&!z(e);){if(pt(e))return e;if(it(e))return null;e=C(e)}return null}function gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(B(t))}function O(t){return E(t).getComputedStyle(t)}function st(t){return R(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||T(t);return Rt(e)?e.host:e}function jt(t){const e=C(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:L(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=O(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=L(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 yt(t){return R(t)?t:t.contextElement}function H(t){const e=yt(t);if(!L(e))return P(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 Ce=P(0);function Yt(t){const e=E(t);return!gt()||!e.visualViewport?Ce:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Fe(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=yt(t);let s=P(1);e&&(o?R(o)&&(s=H(o)):s=H(t));const c=Fe(i,n,o)?Yt(i):P(0);let a=(r.left+c.x)/s.x,l=(r.top+c.y)/s.y,f=r.width/s.x,m=r.height/s.y;if(i){const h=E(i),d=o&&R(o)?E(o):o;let g=h,y=ut(g);for(;y&&o&&d!==g;){const w=H(y),p=y.getBoundingClientRect(),x=O(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,f*=w.x,m*=w.y,a+=v,l+=A,g=E(y),y=ut(g)}}return tt({width:f,height:m,x:a,y:l})}function We(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=T(o),c=e?it(e.floating):!1;if(o===s||c&&i)return n;let a={scrollLeft:0,scrollTop:0},l=P(1);const f=P(0),m=L(o);if((m||!m&&!i)&&((B(o)!=="body"||Y(s))&&(a=st(o)),L(o))){const h=M(o);l=H(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+f.x,y:n.y*l.y-a.scrollTop*l.y+f.y}}function De(t){return Array.from(t.getClientRects())}function ft(t,e){const n=st(t).scrollLeft;return e?e.left+n:M(T(t)).left+n}function Me(t){const e=T(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+ft(t);const c=-n.scrollTop;return O(o).direction==="rtl"&&(s+=W(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}function Ve(t,e){const n=E(t),o=T(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=gt();(!l||l&&e==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:s,x:c,y:a}}function Ne(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=L(t)?H(t):P(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 Ot(t,e,n){let o;if(e==="viewport")o=Ve(t,n);else if(e==="document")o=Me(T(t));else if(R(e))o=Ne(e,n);else{const r=Yt(t);o={...e,x:e.x-r.x,y:e.y-r.y}}return tt(o)}function Xt(t,e){const n=C(t);return n===e||!R(n)||z(n)?!1:O(n).position==="fixed"||Xt(n,e)}function He(t,e){const n=e.get(t);if(n)return n;let o=j(t,[],!1).filter(c=>R(c)&&B(c)!=="body"),r=null;const i=O(t).position==="fixed";let s=i?C(t):t;for(;R(s)&&!z(s);){const c=O(s),a=pt(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(f=>f!==s):r=c,s=C(s)}return e.set(t,o),o}function $e(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?it(e)?[]:He(e,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,f)=>{const m=Ot(e,f,r);return l.top=W(m.top,l.top),l.right=G(m.right,l.right),l.bottom=G(m.bottom,l.bottom),l.left=W(m.left,l.left),l},Ot(e,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ze(t){const{width:e,height:n}=qt(t);return{width:e,height:n}}function Be(t,e,n){const o=L(e),r=T(e),i=n==="fixed",s=M(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const a=P(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=ft(r));let l=0,f=0;if(r&&!o&&!i){const d=r.getBoundingClientRect();f=d.top+c.scrollTop,l=d.left+c.scrollLeft-ft(r,d)}const m=s.left+c.scrollLeft-a.x-l,h=s.top+c.scrollTop-a.y-f;return{x:m,y:h,width:s.width,height:s.height}}function lt(t){return O(t).position==="static"}function Lt(t,e){if(!L(t)||O(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return T(t)===n&&(n=n.ownerDocument.body),n}function Kt(t,e){const n=E(t);if(it(t))return n;if(!L(t)){let r=C(t);for(;r&&!z(r);){if(R(r)&&!lt(r))return r;r=C(r)}return n}let o=Lt(t,e);for(;o&&Se(o)&<(o);)o=Lt(o,e);return o&&z(o)&<(o)&&!pt(o)?n:o||Pe(t)||n}const Ue=async function(t){const e=this.getOffsetParent||Kt,n=this.getDimensions,o=await n(t.floating);return{reference:Be(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function _e(t){return O(t).direction==="rtl"}const Ie={convertOffsetParentRelativeRectToViewportRelativeRect:We,getDocumentElement:T,getClippingRect:$e,getOffsetParent:Kt,getElementRects:Ue,getClientRects:De,getDimensions:ze,getScale:H,isElement:R,isRTL:_e};function je(t,e){let n=null,o;const r=T(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:f,width:m,height:h}=t.getBoundingClientRect();if(c||e(),!m||!h)return;const d=K(f),g=K(r.clientWidth-(l+m)),y=K(r.clientHeight-(f+h)),w=K(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 qe(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=yt(t),f=r||i?[...l?j(l):[],...j(e)]:[];f.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),i&&p.addEventListener("resize",n)});const m=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;f.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),m==null||m(),(p=d)==null||p.disconnect(),d=null,a&&cancelAnimationFrame(g)}}const Ye=Te,Xe=ke,Tt=Oe,Ke=(t,e,n)=>{const o=new Map,r={platform:Ie,...n},i={...r.platform,_c:o};return Re(t,e,{...r,platform:i})},Je=({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.When(s,u.Portal("body",u.html.div(u.OnElement(a=>{const l=a;return l.style.position="absolute",qe(c,l,()=>{Ke(c,l,{placement:n,strategy:"absolute",middleware:[Tt(),Ye({mainAxis:o,crossAxis:r}),Xe(),Tt()]}).then(({x:f,y:m})=>{l.style.top=`${m}px`,l.style.left=`${f}px`})})}),t())))(i)}),Jt=(t,e)=>{if(typeof e=="function")return Jt(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)})},Ge=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),Qe=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)}}),Ze=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)}},Gt=(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}},Qt=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!==""),Zt=t=>{const e=t.map(n=>{const o=Qt(n);return{route:n,segments:o}});return function(o){for(const{segments:r,route:i}of e){const s=Gt(r,o);if(s)return{...s,route:i}}return null}},tn=t=>{const e=Zt(Object.keys(t));return dt(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,mt=60*et,q=24*mt,kt=7*q,St=30*q,en=365*q,nn=[{max:et*90,value:et,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:mt*36,value:mt,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:en,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 te(t){const e=Math.abs(t);if(e<et)return t<0?"just now":"in a moment";for(const n of nn)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 on=(t,e)=>{const n=e!=null?u.Signal.is(e)?e.map(i=>i):u.makeProp(e):u.makeProp(new Date),o=u.makeComputedOf(t,n)((i,s)=>{const c=i.getTime()-s.getTime();return te(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=ae;exports.AutoSelect=ue;exports.ElementSize=Qe;exports.HTMLTitle=me;exports.HiddenWhenEmpty=fe;exports.InViewport=$t;exports.LocationProviderMarker=Dt;exports.PopOver=Je;exports.ProvideAppearance=ce;exports.ProvideLocation=re;exports.ResultView=Jt;exports.Router=tn;exports.SelectOnFocus=Ge;exports.UseAppearance=le;exports.UseLocation=dt;exports.WhenInViewport=pe;exports.WindowSize=Ze;exports._checkExtensionCondition=Ft;exports._getExtension=Ct;exports._makeRouteMatcher=Zt;exports._parseRouteSegments=Qt;exports.appearanceMarker=ht;exports.areLocationsEqual=ie;exports.handleAnchorClick=Wt;exports.locationFromURL=Mt;exports.makeRelativeTime=on;exports.matchesRoute=Gt;exports.setLocationFromUrl=Vt;exports.timeDiffToString=te;exports.urlFromLocation=se;
|