@stacksjs/composables 0.70.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -0
- package/package.json +56 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
function L(J){if(J&&typeof J==="object"&&"value"in J&&"subscribe"in J)return J.value;return J}function T(J){if(typeof J==="function")return J();return L(J)}function j(J){return J!==null&&typeof J==="object"&&"value"in J&&"subscribe"in J}function N(){}function U(){return typeof window<"u"?window:void 0}function a(){return typeof document<"u"?document:void 0}function FJ(){return typeof navigator<"u"?navigator:void 0}var iJ=new Map;function S9(J){return iJ.get(J)}function x9(J,$){iJ.set(J,$)}var y9="stx-storage";import{onUnmounted as w9,ref as k9,watch as g9}from"@stacksjs/stx";function t(J,$,Q,G){let Z=Q??(typeof localStorage<"u"?localStorage:void 0),K=G?.serializer??{read:(M)=>{try{return JSON.parse(M)}catch{return M}},write:(M)=>JSON.stringify(M)},q=$;if(Z)try{let M=Z.getItem(J);if(M!==null)q=K.read(M)}catch{}let z=k9(q);if(g9(z,(M)=>{if(!Z)return;try{if(M===null||M===void 0)Z.removeItem(J);else Z.setItem(J,K.write(M))}catch(B){let W=B?.name??"",X=B?.message??String(B);if(W==="QuotaExceededError"||/quota/i.test(X))console.warn(`[useStorage] ${J}: storage quota exceeded \u2014 value not persisted.`);else console.warn(`[useStorage] ${J}: failed to persist value \u2014 ${X}`)}}),typeof window<"u"){let M=(B)=>{if(B.key!==J||B.storageArea!==Z)return;if(B.newValue===null)z.value=$;else try{z.value=K.read(B.newValue)}catch{z.value=$}};window.addEventListener("storage",M),w9(()=>window.removeEventListener("storage",M))}return z}function h9(J,$,Q){return t(J,$,typeof localStorage<"u"?localStorage:void 0,Q)}function v9(J,$,Q){return t(J,$,typeof sessionStorage<"u"?sessionStorage:void 0,Q)}import{onUnmounted as f9,ref as rJ,watch as m9}from"@stacksjs/stx";function sJ(){let J=rJ(!1);if(typeof window<"u"&&window.matchMedia){let $=window.matchMedia("(prefers-color-scheme: dark)");J.value=$.matches;let Q=(G)=>{J.value=G.matches};$.addEventListener("change",Q);try{f9(()=>{$.removeEventListener("change",Q)})}catch{}}return J}function p9(){let $=sJ().value;if(typeof localStorage<"u"){let G=localStorage.getItem("color-scheme");if(G==="dark")$=!0;else if(G==="light")$=!1}let Q=rJ($);if(m9(Q,(G)=>{if(typeof document<"u")document.documentElement.classList.toggle("dark",G);if(typeof localStorage<"u")localStorage.setItem("color-scheme",G?"dark":"light")}),typeof document<"u")document.documentElement.classList.toggle("dark",Q.value);return Q}import{onUnmounted as d9,ref as LJ,watch as OJ}from"@stacksjs/stx";function u9(J={}){let{attribute:$="class",initialValue:Q="auto",modes:G={},storageKey:Z="color-mode",selector:K}=J,q=LJ("light");if(typeof window<"u"&&window.matchMedia){let X=window.matchMedia("(prefers-color-scheme: dark)");q.value=X.matches?"dark":"light";let _=(Y)=>{q.value=Y.matches?"dark":"light"};X.addEventListener("change",_);try{d9(()=>{X.removeEventListener("change",_)})}catch{}}let z=Q;if(typeof localStorage<"u"){let X=localStorage.getItem(Z);if(X)z=X}let M=LJ(z),B=LJ(M.value==="auto"?q.value:M.value);function W(X){if(typeof document>"u")return;let _=K?document.querySelector(K):document.documentElement;if(!_)return;let Y=G[X]??X;if($==="class"){let H=["dark","light",...Object.keys(G),...Object.values(G)];for(let F of H)_.classList.remove(F);if(Y)_.classList.add(Y)}else _.setAttribute($,Y)}return OJ(M,(X)=>{if(typeof localStorage<"u")localStorage.setItem(Z,X);B.value=X==="auto"?q.value:X}),OJ(q,(X)=>{if(M.value==="auto")B.value=X}),OJ(B,(X)=>{W(X)}),W(B.value),{mode:B,system:q,store:M}}import{onUnmounted as c9,ref as l9}from"@stacksjs/stx";function i9(){let J=l9("no-preference");if(typeof window>"u"||!window.matchMedia)return J;let $=window.matchMedia("(prefers-color-scheme: dark)"),Q=window.matchMedia("(prefers-color-scheme: light)");function G(){if($.matches)J.value="dark";else if(Q.matches)J.value="light";else J.value="no-preference"}G(),$.addEventListener("change",G),Q.addEventListener("change",G);try{c9(()=>{$.removeEventListener("change",G),Q.removeEventListener("change",G)})}catch{}return J}import{onUnmounted as r9,ref as s9}from"@stacksjs/stx";function n9(){let J=s9("no-preference");if(typeof window>"u"||!window.matchMedia)return J;let $=window.matchMedia("(prefers-contrast: more)"),Q=window.matchMedia("(prefers-contrast: less)"),G=window.matchMedia("(prefers-contrast: custom)");function Z(){if($.matches)J.value="more";else if(Q.matches)J.value="less";else if(G.matches)J.value="custom";else J.value="no-preference"}Z(),$.addEventListener("change",Z),Q.addEventListener("change",Z),G.addEventListener("change",Z);try{r9(()=>{$.removeEventListener("change",Z),Q.removeEventListener("change",Z),G.removeEventListener("change",Z)})}catch{}return J}import{onUnmounted as o9,ref as a9}from"@stacksjs/stx";function t9(){let J=a9("no-preference");if(typeof window>"u"||!window.matchMedia)return J;let $=window.matchMedia("(prefers-reduced-motion: reduce)");function Q(){J.value=$.matches?"reduce":"no-preference"}Q(),$.addEventListener("change",Q);try{o9(()=>{$.removeEventListener("change",Q)})}catch{}return J}import{onUnmounted as e9,ref as J$}from"@stacksjs/stx";function $$(){let J=J$(typeof navigator<"u"?navigator.onLine:!0);if(typeof window<"u"){let $=()=>{J.value=!0},Q=()=>{J.value=!1};window.addEventListener("online",$),window.addEventListener("offline",Q);try{e9(()=>{window.removeEventListener("online",$),window.removeEventListener("offline",Q)})}catch{}}return J}import{onUnmounted as nJ,ref as g}from"@stacksjs/stx";function Q$(){let J=g(typeof navigator<"u"&&"connection"in navigator),$=g(typeof navigator<"u"?navigator.onLine:!0),Q=g(void 0),G=g(void 0),Z=g(void 0),K=g(void 0),q=g(void 0),z=g(void 0),M=g(void 0),B=g(void 0);function W(){if(!J.value)return;let X=navigator.connection;if(X)Z.value=X.downlink,K.value=X.downlinkMax,q.value=X.effectiveType,z.value=X.rtt,M.value=X.saveData,B.value=X.type}if(W(),typeof window<"u"){let X=()=>{$.value=!0,G.value=Date.now()},_=()=>{$.value=!1,Q.value=Date.now()};window.addEventListener("online",X),window.addEventListener("offline",_);try{nJ(()=>{window.removeEventListener("online",X),window.removeEventListener("offline",_)})}catch{}if(J.value){let Y=navigator.connection;if(Y?.addEventListener){Y.addEventListener("change",W);try{nJ(()=>{Y.removeEventListener("change",W)})}catch{}}}}return{isSupported:J,isOnline:$,offlineAt:Q,onlineAt:G,downlink:Z,downlinkMax:K,effectiveType:q,rtt:z,saveData:M,type:B}}import{ref as Z$}from"@stacksjs/stx";function G$(J=!1){let $=typeof J==="boolean"?Z$(J):J;function Q(G){if(typeof G==="boolean")$.value=G;else $.value=!$.value;return $.value}return[$,Q]}import{ref as AJ}from"@stacksjs/stx";function NJ(J){let $="GET",Q,G={get(){return $="GET",Q=void 0,G},post(Z){return $="POST",Q=Z,G},patch(Z){return $="PATCH",Q=Z,G},put(Z){return $="PUT",Q=Z,G},delete(){return $="DELETE",Q=void 0,G},json(){let Z=AJ(null),K=AJ(null),q=AJ(!0),z={method:$,headers:{Accept:"application/json"}};if(Q&&$!=="GET"&&$!=="DELETE")z.headers={...z.headers,"Content-Type":"application/json"},z.body=Q;let M={data:Z,error:K},B=fetch(J,z).then(async(W)=>{let X=await W.json();if(W.ok)Z.value=X;else K.value=X}).catch((W)=>{K.value=W}).finally(()=>{q.value=!1});return{data:Z,error:K,isFetching:q,then(W){return B.then(()=>W(M))}}}};return G}function K$(J={}){let{baseUrl:$=""}=J;return function(Q){let G=$?`${$.replace(/\/$/,"")}/${Q.replace(/^\//,"")}`:Q;return NJ(G)}}import{computed as q$,ref as z$}from"@stacksjs/stx";import{format as oJ}from"@stacksjs/datetime";function M$(J,$){if(typeof J==="object"&&J!==null&&"value"in J&&"subscribe"in J)return q$(()=>{let G=J.value;return oJ(G instanceof Date?G:new Date(G),$)});let Q=J instanceof Date?J:new Date(J);return z$(oJ(Q,$))}import{onUnmounted as B$,ref as X$}from"@stacksjs/stx";function W$(J){let $=J?.interval??1000,Q=X$(new Date),G=setInterval(()=>{Q.value=new Date},$);try{B$(()=>clearInterval(G))}catch{}return Q}import{onUnmounted as _$,ref as Y$}from"@stacksjs/stx";function H$(J={}){let{offset:$=0,interval:Q=1000,immediate:G=!0}=J,Z=Y$(Date.now()+$),K=null,q=null,z=!1;function M(){Z.value=Date.now()+$}function B(){if(K!==null)clearInterval(K),K=null;if(q!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(q),q=null;z=!1}function W(){if(z)return;if(z=!0,M(),Q==="requestAnimationFrame"){if(typeof requestAnimationFrame<"u"){let X=()=>{if(!z)return;M(),q=requestAnimationFrame(X)};q=requestAnimationFrame(X)}}else K=setInterval(M,Q)}if(G)W();try{_$(B)}catch{}return Z}import{onUnmounted as F$,ref as L$}from"@stacksjs/stx";var PJ=1000,DJ=60*PJ,CJ=60*DJ,e=24*CJ,aJ=7*e,tJ=30*e,eJ=365*e;function O$(J){let $=Math.abs(J);if($<5*PJ)return"just now";let Q=J<0,G,Z;if($<DJ)G=Math.floor($/PJ),Z="second";else if($<CJ)G=Math.floor($/DJ),Z="minute";else if($<e)G=Math.floor($/CJ),Z="hour";else if($<aJ)G=Math.floor($/e),Z="day";else if($<tJ)G=Math.floor($/aJ),Z="week";else if($<eJ)G=Math.floor($/tJ),Z="month";else G=Math.floor($/eJ),Z="year";let K=G!==1?"s":"";if(Q)return`in ${G} ${Z}${K}`;return`${G} ${Z}${K} ago`}function A$(J,$={}){let{updateInterval:Q=30000}=$;function G(){let z=T(J);if(z instanceof Date)return z.getTime();if(typeof z==="number")return z;return new Date(z).getTime()}function Z(){let z=Date.now(),M=G(),B=z-M;return O$(B)}let K=L$(Z()),q=setInterval(()=>{K.value=Z()},Q);try{F$(()=>clearInterval(q))}catch{}return K}import{onUnmounted as N$,watch as P$}from"@stacksjs/stx";function D$(J,$,Q,G){let Z=N,K=(z)=>{if(!z)return N;return z.addEventListener($,Q,G),()=>{z.removeEventListener($,Q,G)}};if(j(J))P$(J,(z,M)=>{Z(),Z=K(L(J))}),Z=K(J.value);else Z=K(J);let q=()=>{Z(),Z=N};try{N$(q)}catch{}return q}import{onUnmounted as C$}from"@stacksjs/stx";var EJ=new Map;function E$(J){if(!EJ.has(J))EJ.set(J,new Set);let $=EJ.get(J),Q=[];function G(M){return $.add(M),Q.push(M),()=>q(M)}function Z(M){let B=(W)=>{M(W),q(B)};return G(B)}function K(M){for(let B of $)B(M)}function q(M){$.delete(M);let B=Q.indexOf(M);if(B!==-1)Q.splice(B,1)}function z(){$.clear(),Q.length=0}try{C$(()=>{for(let M of Q)$.delete(M);Q.length=0})}catch{}return{on:G,once:Z,emit:K,off:q,reset:z}}function JJ(){let J=new Set;function $(Z){return J.add(Z),{off:()=>J.delete(Z)}}function Q(Z){J.delete(Z)}function G(Z){for(let K of J)K(Z)}return{on:$,off:Q,trigger:G}}function T$(J,$=200){let Q=null,G=function(...Z){if(Q!==null)clearTimeout(Q);Q=setTimeout(()=>{Q=null,J.apply(this,Z)},$)};return G.cancel=()=>{if(Q!==null)clearTimeout(Q),Q=null},G}function V$(J,$=200){let Q=0,G=null,Z=null,K=null,q=function(...z){let M=Date.now(),B=M-Q;if(B>=$){if(Q=M,G!==null)clearTimeout(G),G=null;J.apply(this,z)}else if(Z=z,K=this,G===null)G=setTimeout(()=>{if(Q=Date.now(),G=null,Z!==null)J.apply(K,Z),Z=null,K=null},$-B)};return q.cancel=()=>{if(G!==null)clearTimeout(G),G=null;Z=null,K=null},q}import{ref as J9,watch as j$}from"@stacksjs/stx";function TJ(J,$=200){let Q=J9(J),G=J9(J),Z=null;return j$(Q,(K)=>{if(Z!==null)clearTimeout(Z);Z=setTimeout(()=>{G.value=K,Z=null},$)}),{get value(){return G.value},set value(K){Q.value=K},subscribe:G.subscribe}}import{ref as $9,watch as U$}from"@stacksjs/stx";function VJ(J,$=200){let Q=$9(J),G=$9(J),Z=0,K=null;return U$(Q,(q)=>{let z=Date.now(),M=z-Z;if(M>=$){if(Z=z,G.value=q,K!==null)clearTimeout(K),K=null}else if(K===null)K=setTimeout(()=>{Z=Date.now(),G.value=Q.value,K=null},$-M)}),{get value(){return G.value},set value(q){Q.value=q},subscribe:G.subscribe}}import{ref as R$,watch as I$}from"@stacksjs/stx";function b$(J,$=200){let Q=R$(L(J)),G=null;if(j(J))I$(J,(Z)=>{if(G!==null)clearTimeout(G);G=setTimeout(()=>{Q.value=Z,G=null},$)});return Q}import{ref as S$,watch as x$}from"@stacksjs/stx";function y$(J,$=200){let Q=S$(L(J)),G=0,Z=null;if(j(J))x$(J,(K)=>{let q=Date.now(),z=q-G;if(z>=$)Q.value=K,G=q;else{if(Z!==null)clearTimeout(Z);Z=setTimeout(()=>{Q.value=J.value,G=Date.now(),Z=null},$-z)}});return Q}import{onUnmounted as w$,ref as k$}from"@stacksjs/stx";function g$(J=1000,$={}){let{controls:Q=!1,immediate:G=!0}=$,Z=k$(0),K=null;function q(){if(K!==null)clearInterval(K),K=null}function z(){if(K!==null)return;K=setInterval(()=>{Z.value++},J)}function M(){if(Z.value=0,q(),G)z()}if(G)z();try{w$(q)}catch{}if(Q)return{counter:Z,pause:q,resume:z,reset:M};return Z}import{onUnmounted as h$,ref as v$}from"@stacksjs/stx";function f$(J,$=1000,Q={}){let{immediate:G=!0}=Q,Z=v$(!1),K=null;function q(){if(K!==null)clearInterval(K),K=null;Z.value=!1}function z(){if(K!==null)return;Z.value=!0,K=setInterval(J,$)}if(G)z();try{h$(q)}catch{}return{pause:q,resume:z,isActive:Z}}import{onUnmounted as m$,ref as p$}from"@stacksjs/stx";function d$(J=1000,$={}){let{controls:Q=!1,immediate:G=!0}=$,Z=p$(!1),K=null;function q(){if(K!==null)clearTimeout(K),K=null;Z.value=!1}function z(){q(),K=setTimeout(()=>{Z.value=!0,K=null},J)}if(G)z();try{m$(()=>{if(K!==null)clearTimeout(K),K=null})}catch{}if(Q)return{ready:Z,start:z,stop:q};return Z}import{onUnmounted as u$,ref as c$}from"@stacksjs/stx";function l$(J,$=1000,Q={}){let{immediate:G=!0}=Q,Z=c$(!1),K=null;function q(){if(K!==null)clearTimeout(K),K=null;Z.value=!1}function z(){q(),Z.value=!0,K=setTimeout(()=>{K=null,Z.value=!1,J()},$)}if(G)z();try{u$(q)}catch{}return{start:z,stop:q,isPending:Z}}import{onUnmounted as i$,ref as r$}from"@stacksjs/stx";function s$(J,$,Q){let{immediate:G=!0}=Q??{},Z=r$(!1),K=null;async function q(){if(!Z.value)return;try{await J()}catch{}if(Z.value)K=setTimeout(q,$)}function z(){if(Z.value)return;Z.value=!0,q()}function M(){if(Z.value=!1,K!==null)clearTimeout(K),K=null}if(G)z();try{i$(()=>M())}catch{}return{isActive:Z,pause:M,resume:z}}import{onUnmounted as n$,ref as o$}from"@stacksjs/stx";function a$(J,$={}){let{immediate:Q=!0}=$,G=o$(!1),Z=null,K=0;function q(B){if(!G.value)return;let W=K?B-K:0;K=B,J({delta:W,timestamp:B}),Z=requestAnimationFrame(q)}function z(){if(G.value)return;if(typeof requestAnimationFrame>"u")return;G.value=!0,K=0,Z=requestAnimationFrame(q)}function M(){if(!G.value)return;if(G.value=!1,Z!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(Z),Z=null}if(Q)z();try{n$(M)}catch{}return{pause:M,resume:z,isActive:G}}import{onUnmounted as t$,ref as e$}from"@stacksjs/stx";function J4(J=10){let $=e$(0);if(typeof requestAnimationFrame>"u")return $;let Q=performance.now(),G=0,Z;function K(){if(G++,G>=J){let q=performance.now(),z=q-Q;$.value=Math.round(G/z*1000),Q=q,G=0}Z=requestAnimationFrame(K)}Z=requestAnimationFrame(K);try{t$(()=>cancelAnimationFrame(Z))}catch{}return $}import{ref as jJ}from"@stacksjs/stx";function $4(J){let{source:$,copiedDuring:Q=1500}=J??{},G=FJ(),Z=jJ(!!G&&"clipboard"in G),K=jJ(""),q=jJ(!1),z;async function M(B){if(!Z.value)return;let W=B??($!==void 0?T($):void 0);if(W===void 0)return;try{if(await G.clipboard.writeText(W),K.value=W,q.value=!0,z)clearTimeout(z);z=setTimeout(()=>{q.value=!1},Q)}catch{}}return{text:K,isSupported:Z,copied:q,copy:M}}import{ref as Q9}from"@stacksjs/stx";function Q4(){let J=Q9(typeof navigator<"u"&&"clipboard"in navigator&&typeof ClipboardItem<"u"),$=Q9([]);async function Q(Z){if(J.value)await navigator.clipboard.write(Z),$.value=Z}async function G(){if(J.value)$.value=await navigator.clipboard.read()}return{isSupported:J,content:$,copy:Q,read:G}}import{onUnmounted as Z4,ref as G4}from"@stacksjs/stx";function K4(J){let $=U(),Q=G4(!1);if(!$||!$.matchMedia)return Q;let G=T(J),Z=$.matchMedia(G);Q.value=Z.matches;let K=(q)=>{Q.value=q.matches};Z.addEventListener("change",K);try{Z4(()=>{Z.removeEventListener("change",K)})}catch{}return Q}import{computed as s,ref as q4,onUnmounted as z4}from"@stacksjs/stx";function M4(J){let $=U(),Q=q4($?$.innerWidth:0);function G(){if($)Q.value=$.innerWidth}if($){$.addEventListener("resize",G);try{z4(()=>{$.removeEventListener("resize",G)})}catch{}}function Z(X){return J[X]}function K(X){return s(()=>Q.value>=Z(X))}function q(X){return s(()=>Q.value<=Z(X))}function z(X,_){return s(()=>Q.value>=Z(X)&&Q.value<Z(_))}function M(X){return s(()=>Q.value>Z(X))}function B(X){return s(()=>Q.value<Z(X))}function W(){return s(()=>{return Object.keys(J).sort((_,Y)=>J[_]-J[Y]).filter((_)=>Q.value>=J[_])})}return{greaterOrEqual:K,smallerOrEqual:q,between:z,isGreater:M,isSmaller:B,current:W}}var B4={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Z9={sm:576,md:768,lg:992,xl:1200,xxl:1400},X4=Z9,W4={xs:480,sm:576,md:768,lg:992,xl:1200,xxl:1600},_4={xs:600,sm:960,md:1264,lg:1904},Y4={xs:600,sm:1024,md:1440,lg:1920},H4={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},F4={mobileS:320,mobileM:375,mobileL:425,tablet:768,laptop:1024,laptopL:1440,desktop:2560};import{ref as L4,watch as O4}from"@stacksjs/stx";function A4(J){let $=a(),Q=J!==void 0?T(J):$?.title??"",G=L4(Q);if($&&J!==void 0)$.title=G.value;return O4(G,(Z)=>{if($)$.title=Z}),G}import{ref as N4,watch as P4}from"@stacksjs/stx";function D4(J){let $=N4(T(J??null));function Q(G){if(typeof document>"u"||!G)return;let Z=document.querySelector('link[rel*="icon"]');if(!Z)Z=document.createElement("link"),Z.rel="icon",Z.type="image/x-icon",document.head.appendChild(Z);Z.href=G}return P4($,(G)=>{Q(G)}),Q($.value),$}import{onUnmounted as C4,ref as E4}from"@stacksjs/stx";function T4(){let J=E4(typeof document<"u"?document.visibilityState:"visible");if(typeof document>"u")return J;let $=()=>{J.value=document.visibilityState};document.addEventListener("visibilitychange",$,{passive:!0});try{C4(()=>{document.removeEventListener("visibilitychange",$)})}catch{}return J}import{ref as V4,watch as j4}from"@stacksjs/stx";function U4(J,$){let Q=J??(typeof document<"u"?document.documentElement:null),G=$??"ltr";if(Q){let K=Q.getAttribute("dir");if(K==="rtl"||K==="ltr"||K==="auto")G=K}let Z=V4(G);return j4(Z,(K)=>{if(Q)Q.setAttribute("dir",K)}),Z}import{onUnmounted as R4,ref as UJ}from"@stacksjs/stx";function I4(){let J=UJ(""),$=UJ([]),Q=UJ(null);if(typeof document>"u")return{text:J,ranges:$,selection:Q};let G=()=>{let Z=document.getSelection();if(Q.value=Z,Z&&Z.rangeCount>0){J.value=Z.toString();let K=[];for(let q=0;q<Z.rangeCount;q++)K.push(Z.getRangeAt(q));$.value=K}else J.value="",$.value=[]};document.addEventListener("selectionchange",G,{passive:!0});try{R4(()=>{document.removeEventListener("selectionchange",G)})}catch{}return{text:J,ranges:$,selection:Q}}import{onUnmounted as b4,ref as S4}from"@stacksjs/stx";function x4(J="history",$){let Q=U(),{initialValue:G}=$??{};function Z(){if(!Q)return{...G};let W="";if(J==="hash"){let Y=Q.location.hash,H=Y.indexOf("?");W=H>=0?Y.slice(H+1):""}else W=Q.location.search.slice(1);let X={...G};return new URLSearchParams(W).forEach((Y,H)=>{X[H]=Y}),X}let K=S4(Z());function q(){if(!Q)return;let W=new URLSearchParams;for(let[_,Y]of Object.entries(K.value))if(Y!==void 0&&Y!==null&&Y!=="")W.set(_,Y);let X=W.toString();if(J==="hash"){let _=Q.location.hash.split("?")[0]||"#";Q.location.hash=X?`${_}?${X}`:_}else{let _=X?`${Q.location.pathname}?${X}`:Q.location.pathname;Q.history.replaceState(Q.history.state,"",_)}}function z(W){return K.value[W]??null}function M(W,X){let _={...K.value};_[W]=X,K.value=_,q()}function B(W){let X={...K.value};delete X[W],K.value=X,q()}if(Q){let W=()=>{K.value=Z()},X=()=>{if(J==="hash")K.value=Z()};Q.addEventListener("popstate",W),Q.addEventListener("hashchange",X),b4(()=>{Q.removeEventListener("popstate",W),Q.removeEventListener("hashchange",X)})}return{params:K,get:z,set:M,delete:B}}import{onUnmounted as y4,ref as f}from"@stacksjs/stx";function w4(){let J=U();function $(){if(!J)return{href:"",protocol:"",host:"",hostname:"",port:"",pathname:"",search:"",hash:"",origin:""};return{href:J.location.href,protocol:J.location.protocol,host:J.location.host,hostname:J.location.hostname,port:J.location.port,pathname:J.location.pathname,search:J.location.search,hash:J.location.hash,origin:J.location.origin}}let Q=$(),G=f(Q.href),Z=f(Q.protocol),K=f(Q.host),q=f(Q.hostname),z=f(Q.port),M=f(Q.pathname),B=f(Q.search),W=f(Q.hash),X=f(Q.origin);function _(){let Y=$();G.value=Y.href,Z.value=Y.protocol,K.value=Y.host,q.value=Y.hostname,z.value=Y.port,M.value=Y.pathname,B.value=Y.search,W.value=Y.hash,X.value=Y.origin}if(J){J.addEventListener("popstate",_),J.addEventListener("hashchange",_);try{y4(()=>{J.removeEventListener("popstate",_),J.removeEventListener("hashchange",_)})}catch{}}return{href:G,protocol:Z,host:K,hostname:q,port:z,pathname:M,search:B,hash:W,origin:X}}import{onUnmounted as k4,ref as G9}from"@stacksjs/stx";function g4(J){let{initialWidth:$=0,initialHeight:Q=0,listenOrientation:G=!0}=J??{},Z=U(),K=G9(Z?Z.innerWidth:$),q=G9(Z?Z.innerHeight:Q);function z(){if(Z)K.value=Z.innerWidth,q.value=Z.innerHeight}if(Z){if(Z.addEventListener("resize",z),G)Z.addEventListener("orientationchange",z);try{k4(()=>{if(Z.removeEventListener("resize",z),G)Z.removeEventListener("orientationchange",z)})}catch{}}return{width:K,height:q}}import{onUnmounted as h4,ref as v4}from"@stacksjs/stx";function f4(){let J=v4(typeof document<"u"?document.hasFocus():!1);if(typeof window>"u")return J;let $=()=>{J.value=!0},Q=()=>{J.value=!1};window.addEventListener("focus",$,{passive:!0}),window.addEventListener("blur",Q,{passive:!0});try{h4(()=>{window.removeEventListener("focus",$),window.removeEventListener("blur",Q)})}catch{}return J}import{onUnmounted as m4,ref as K9}from"@stacksjs/stx";function p4(){let J=K9(typeof window<"u"?window.scrollX:0),$=K9(typeof window<"u"?window.scrollY:0);if(typeof window>"u")return{x:J,y:$};let Q=()=>{J.value=window.scrollX,$.value=window.scrollY};window.addEventListener("scroll",Q,{passive:!0});try{m4(()=>{window.removeEventListener("scroll",Q)})}catch{}return{x:J,y:$}}import{onUnmounted as d4,ref as x}from"@stacksjs/stx";function u4(J,$){let{throttle:Q=0,offset:G={}}=$??{},Z=G.top??0,K=G.bottom??0,q=G.left??0,z=G.right??0,M=x(0),B=x(0),W=x(!1),X=x(!0),_=x(!1),Y=x(!0),H=x(!1),F=x(!1),O=x(!1),P=x(!1),C=x(!1),E,b=0,u=0,c,l=!1;function r(D){if(typeof window<"u"&&D===window||"innerHeight"in D&&"scrollX"in D){let I=D,lJ=typeof document<"u"?document:void 0;return{scrollLeft:I.scrollX??I.pageXOffset??0,scrollTop:I.scrollY??I.pageYOffset??0,scrollHeight:lJ?.documentElement?.scrollHeight??0,scrollWidth:lJ?.documentElement?.scrollWidth??0,clientHeight:I.innerHeight,clientWidth:I.innerWidth}}if(typeof document<"u"&&D===document||"documentElement"in D){let I=D.documentElement;return{scrollLeft:I.scrollLeft,scrollTop:I.scrollTop,scrollHeight:I.scrollHeight,scrollWidth:I.scrollWidth,clientHeight:I.clientHeight,clientWidth:I.clientWidth}}let A=D;return{scrollLeft:A.scrollLeft,scrollTop:A.scrollTop,scrollHeight:A.scrollHeight,scrollWidth:A.scrollWidth,clientHeight:A.clientHeight,clientWidth:A.clientWidth}}function BJ(){let D=J?L(J):typeof window<"u"?window:null;if(!D)return;let A=r(D);if(F.value=A.scrollTop<u,O.value=A.scrollTop>u,P.value=A.scrollLeft<b,C.value=A.scrollLeft>b,b=A.scrollLeft,u=A.scrollTop,M.value=A.scrollLeft,B.value=A.scrollTop,X.value=A.scrollTop<=Z,Y.value=A.scrollLeft<=q,_.value=A.scrollTop+A.clientHeight>=A.scrollHeight-K,H.value=A.scrollLeft+A.clientWidth>=A.scrollWidth-z,W.value=!0,E)clearTimeout(E);E=setTimeout(()=>{W.value=!1},150)}function S(){if(Q>0){if(!l)BJ(),l=!0,c=setTimeout(()=>{l=!1},Q)}else BJ()}if(typeof window<"u"){let D=J?L(J):window;if(D){let A=r(D);M.value=A.scrollLeft,B.value=A.scrollTop,b=A.scrollLeft,u=A.scrollTop,X.value=A.scrollTop<=Z,Y.value=A.scrollLeft<=q,_.value=A.scrollTop+A.clientHeight>=A.scrollHeight-K,H.value=A.scrollLeft+A.clientWidth>=A.scrollWidth-z,D.addEventListener("scroll",S,{passive:!0});try{d4(()=>{if(D.removeEventListener("scroll",S),E)clearTimeout(E);if(c)clearTimeout(c)})}catch{}}}return{x:M,y:B,isScrolling:W,arrivedState:{top:X,bottom:_,left:Y,right:H},directions:{top:F,bottom:O,left:P,right:C}}}import{onUnmounted as c4,ref as l4,watch as i4}from"@stacksjs/stx";function r4(J){let $=l4(!1),Q="";function G(){if(J)return L(J);if(typeof document<"u")return document.body;return null}function Z(){let q=G();if(!q)return;Q=q.style.overflow,q.style.overflow="hidden"}function K(){let q=G();if(!q)return;q.style.overflow=Q}i4($,(q)=>{if(q)Z();else K()});try{c4(()=>{if($.value)K()})}catch{}return $}import{onUnmounted as s4,ref as n4}from"@stacksjs/stx";function o4(J,$,Q={}){let{distance:G=100,direction:Z="bottom"}=Q,K=n4(!1),q=!0,z=async()=>{if(!q||K.value)return;let B=L(J);if(!B)return;let W=!1;if(B===window||B===document.documentElement){let X=window.scrollY||document.documentElement.scrollTop,_=document.documentElement.scrollHeight,Y=window.innerHeight;if(Z==="bottom")W=_-X-Y<=G;else if(Z==="top")W=X<=G}else{let X=B;if(Z==="bottom")W=X.scrollHeight-X.scrollTop-X.clientHeight<=G;else if(Z==="top")W=X.scrollTop<=G;else if(Z==="right")W=X.scrollWidth-X.scrollLeft-X.clientWidth<=G;else if(Z==="left")W=X.scrollLeft<=G}if(W){K.value=!0;try{await $()}finally{K.value=!1}}},M=L(J);if(M){let B=M===document.documentElement?window:M;B.addEventListener("scroll",z,{passive:!0});try{s4(()=>{q=!1,B.removeEventListener("scroll",z)})}catch{}}return{isLoading:K}}import{onUnmounted as a4,ref as q9}from"@stacksjs/stx";function t4(J){let $=a(),Q=q9(!1),G=q9(!!$&&(("fullscreenEnabled"in $)||("webkitFullscreenEnabled"in $)));function Z(){if(J)return L(J);return $?.documentElement??null}function K(){if(!$)return null;return $.fullscreenElement??$.webkitFullscreenElement??null}function q(){Q.value=K()!==null}async function z(){if(!G.value)return;let W=Z();if(!W)return;try{if(W.requestFullscreen)await W.requestFullscreen();else if(W.webkitRequestFullscreen)await W.webkitRequestFullscreen();Q.value=!0}catch{}}async function M(){if(!G.value||!$)return;try{if($.exitFullscreen)await $.exitFullscreen();else if($.webkitExitFullscreen)await $.webkitExitFullscreen();Q.value=!1}catch{}}async function B(){if(Q.value)await M();else await z()}if($){let W=()=>q();$.addEventListener("fullscreenchange",W),$.addEventListener("webkitfullscreenchange",W);try{a4(()=>{$.removeEventListener("fullscreenchange",W),$.removeEventListener("webkitfullscreenchange",W)})}catch{}}return{isFullscreen:Q,isSupported:G,enter:z,exit:M,toggle:B}}function e4(J,$,Q){let G=U();if(!G)return()=>{};let{ignore:Z=[]}=Q??{};function K(z){let M=L(J);if(!M)return;let B=z,W=B.composedPath?.()??[];if(M===B.target||W.includes(M)||M.contains(B.target))return;for(let X of Z){let _=L(X);if(_&&(_===B.target||W.includes(_)||_.contains(B.target)))return}$(B)}return G.addEventListener("pointerdown",K,{passive:!0}),()=>{G.removeEventListener("pointerdown",K)}}function RJ(J,$,Q){let{eventName:G="keydown",target:Z}=Q??{},K=U(),q=Z?L(Z):K;if(!q)return()=>{};function z(X){if(typeof X==="function")return X;if(typeof X==="string")return(_)=>_.key===X;if(Array.isArray(X))return(_)=>X.includes(_.key);return()=>!0}let M=z(J);function B(X){let _=X;if(M(_))$(_)}return q.addEventListener(G,B),()=>{q.removeEventListener(G,B)}}function J6(J,$,Q){return RJ(J,$,{...Q,eventName:"keydown"})}function $6(J,$,Q){return RJ(J,$,{...Q,eventName:"keyup"})}import{onUnmounted as Q6}from"@stacksjs/stx";function Z6(J,$,Q={}){let{delay:G=500,distanceThreshold:Z=10}=Q,K=null,q=0,z=0,M=L(J);if(!M)return()=>{};let B=()=>{if(K!==null)clearTimeout(K),K=null},W=(H)=>{q=H.clientX,z=H.clientY,B(),K=setTimeout(()=>$(H),G)},X=(H)=>{if(K===null)return;let F=Math.abs(H.clientX-q),O=Math.abs(H.clientY-z);if(F>Z||O>Z)B()},_=()=>{B()};M.addEventListener("pointerdown",W),M.addEventListener("pointermove",X),M.addEventListener("pointerup",_),M.addEventListener("pointercancel",_);let Y=()=>{B(),M.removeEventListener("pointerdown",W),M.removeEventListener("pointermove",X),M.removeEventListener("pointerup",_),M.removeEventListener("pointercancel",_)};try{Q6(Y)}catch{}return Y}import{onUnmounted as G6}from"@stacksjs/stx";function K6(J){if(typeof document>"u")return()=>{};let $=(G)=>{let Z=document.activeElement;if(Z){let K=Z.tagName.toLowerCase();if(K==="input"||K==="textarea"||Z.isContentEditable)return}if(G.key.length===1&&!G.ctrlKey&&!G.metaKey&&!G.altKey)J(G)};document.addEventListener("keydown",$);let Q=()=>{document.removeEventListener("keydown",$)};try{G6(Q)}catch{}return Q}import{onUnmounted as q6,ref as z6}from"@stacksjs/stx";function M6(J){let $=z6(!1);if(typeof window>"u")return $;let Q=(G)=>{$.value=G.getModifierState(J)};window.addEventListener("keydown",Q,{passive:!0}),window.addEventListener("keyup",Q,{passive:!0}),window.addEventListener("mousedown",Q,{passive:!0}),window.addEventListener("mouseup",Q,{passive:!0});try{q6(()=>{window.removeEventListener("keydown",Q),window.removeEventListener("keyup",Q),window.removeEventListener("mousedown",Q),window.removeEventListener("mouseup",Q)})}catch{}return $}import{onUnmounted as B6,ref as z9}from"@stacksjs/stx";function X6(){let J=z9(new Set),$=new Map;function Q(Z){let K=Z.toLowerCase();if(!$.has(K))$.set(K,z9(!1));return $.get(K)}function G(){for(let[Z,K]of $)if(Z.includes("+")){let q=Z.split("+").map((z)=>z.trim().toLowerCase());K.value=q.every((z)=>J.value.has(z))}}if(typeof window<"u"){let Z=(q)=>{let z=q.key.toLowerCase();J.value.add(z),J.value=new Set(J.value);let M=Q(z);if(M.value=!0,q.ctrlKey)Q("ctrl").value=!0,J.value.add("ctrl");if(q.shiftKey)Q("shift").value=!0,J.value.add("shift");if(q.altKey)Q("alt").value=!0,J.value.add("alt");if(q.metaKey)Q("meta").value=!0,J.value.add("meta");G()},K=(q)=>{let z=q.key.toLowerCase();J.value.delete(z),J.value=new Set(J.value);let M=Q(z);if(M.value=!1,!q.ctrlKey)Q("ctrl").value=!1,J.value.delete("ctrl");if(!q.shiftKey)Q("shift").value=!1,J.value.delete("shift");if(!q.altKey)Q("alt").value=!1,J.value.delete("alt");if(!q.metaKey)Q("meta").value=!1,J.value.delete("meta");G()};window.addEventListener("keydown",Z,{passive:!0}),window.addEventListener("keyup",K,{passive:!0});try{B6(()=>{window.removeEventListener("keydown",Z),window.removeEventListener("keyup",K)})}catch{}}return new Proxy({current:J},{get(Z,K){if(K==="current")return J;return Q(K)}})}import{computed as R}from"@stacksjs/stx";function V(J){if(J&&typeof J==="object"&&"value"in J&&"subscribe"in J)return J.value;return J}function W6(J){return R(()=>Math.abs(V(J)))}function _6(...J){return R(()=>{let $=J.map(V);return $.length?$.reduce((Q,G)=>Q+G,0)/$.length:0})}function Y6(J){return R(()=>Math.ceil(V(J)))}function H6(J,$,Q){return R(()=>Math.min(V(Q),Math.max(V($),V(J))))}function F6(J){return R(()=>Math.floor(V(J)))}function L6(...J){return R(()=>Math.max(...J.map(V)))}function O6(...J){return R(()=>Math.min(...J.map(V)))}function A6(J,$=0){return R(()=>Number(V(J).toFixed(Math.max(0,Math.min(100,V($))))))}function N6(J){return R(()=>Math.round(V(J)))}function P6(...J){return R(()=>J.map(V).reduce(($,Q)=>$+Q,0))}function D6(J){return R(()=>Math.trunc(V(J)))}function C6(J){return R(()=>!V(J))}function M9(...J){return R(()=>J.some(($)=>V($)))}var E6=M9;function T6(...J){return R(()=>J.every(($)=>V($)))}import{ref as V6}from"@stacksjs/stx";function j6(J=0,$={}){let{min:Q=-1/0,max:G=1/0}=$;function Z(X){return Math.min(G,Math.max(Q,X))}let K=V6(Z(J));function q(X=1){return K.value=Z(K.value+X),K.value}function z(X=1){return K.value=Z(K.value-X),K.value}function M(X){return K.value=Z(X),K.value}function B(X=J){return K.value=Z(X),K.value}function W(){return K.value}return{count:K,inc:q,dec:z,set:M,reset:B,get:W}}import{ref as U6,watch as R6}from"@stacksjs/stx";function I6(J,$){let Q=U6($);return R6(J,(G,Z)=>{Q.value=Z}),Q}import{ref as b6,watch as S6}from"@stacksjs/stx";function x6(J,$={}){let{initialValue:Q=null}=$,G=b6(Q);return S6(J,()=>{G.value=Date.now()}),G}import{computed as IJ,ref as B9}from"@stacksjs/stx";function y6(J,$){let Q=B9([...J]),G=$!==void 0?J.indexOf($):0,Z=B9(G>=0?G:0),K=IJ(()=>Q.value[Z.value]),q=IJ(()=>Z.value===0),z=IJ(()=>Z.value===Q.value.length-1);function M(){if(Z.value<Q.value.length-1)Z.value++}function B(){if(Z.value>0)Z.value--}function W(F){let O=Q.value.indexOf(F);if(O>=0)Z.value=O}function X(F){if(F>=0&&F<Q.value.length)Z.value=F}function _(F){let O=Q.value.indexOf(F);return O>=0&&Z.value<O}function Y(F){let O=Q.value.indexOf(F);return O>=0&&Z.value>O}function H(F){return Q.value[Z.value]===F}return{steps:Q,current:K,index:Z,isFirst:q,isLast:z,next:M,previous:B,goTo:W,goToIndex:X,isBefore:_,isAfter:Y,isCurrent:H}}import{computed as w6,ref as k6}from"@stacksjs/stx";function g6(J,$={}){let Q=J.length;if(Q===0)throw Error("useCycleList requires a non-empty list");let G=$.initialValue!==void 0?J.indexOf($.initialValue):0,Z=k6(G>=0?G:0);function K(X){return J[X]}let q=w6(()=>K(Z.value));function z(X){return(X%Q+Q)%Q}function M(X=1){return Z.value=z(Z.value+X),K(Z.value)}function B(X=1){return Z.value=z(Z.value-X),K(Z.value)}function W(X){return Z.value=z(X),K(Z.value)}return{state:q,index:Z,next:M,prev:B,go:W}}import{computed as h6}from"@stacksjs/stx";function v6(J,$){return h6(()=>{let Q=[...L(J)];if($)return Q.sort($);return Q.sort()})}import{ref as f6,watch as m6}from"@stacksjs/stx";function p6(J){if(typeof structuredClone==="function")return structuredClone(J);return JSON.parse(JSON.stringify(J))}function d6(J,$={}){let Q=$.clone??p6,G=f6(Q(J.value));function Z(){G.value=Q(J.value)}return m6(J,()=>{Z()}),{cloned:G,sync:Z}}import{computed as bJ,ref as X9}from"@stacksjs/stx";function $J(J,$){if(!$)return J;if(typeof structuredClone==="function")return structuredClone(J);return JSON.parse(JSON.stringify(J))}function QJ(J,$={}){let{capacity:Q=1/0,clone:G=!1}=$,Z=X9([{snapshot:$J(J.value,G),timestamp:Date.now()}]),K=X9([]),q=bJ(()=>Z.value.length>1),z=bJ(()=>K.value.length>0),M=bJ(()=>{return Z.value[Z.value.length-1]});function B(){let Y={snapshot:$J(J.value,G),timestamp:Date.now()};if(Z.value=[...Z.value,Y],Q!==1/0&&Z.value.length>Q)Z.value=Z.value.slice(Z.value.length-Q);K.value=[]}function W(){if(Z.value.length<=1)return;let Y=Z.value[Z.value.length-1],H=Z.value.slice(0,-1);if(Z.value=H,Y)K.value=[...K.value,Y];let F=H[H.length-1];if(!F)return;J.value=$J(F.snapshot,G)}function X(){if(K.value.length===0)return;let Y=K.value[K.value.length-1];if(K.value=K.value.slice(0,-1),Y)Z.value=[...Z.value,Y];if(!Y)return;J.value=$J(Y.snapshot,G)}function _(){Z.value=[{snapshot:$J(J.value,G),timestamp:Date.now()}],K.value=[]}return{history:Z,commit:B,undo:W,redo:X,canUndo:q,canRedo:z,clear:_,last:M}}import{computed as SJ,ref as W9,watch as u6}from"@stacksjs/stx";function ZJ(J,$){if(!$)return J;if(typeof structuredClone==="function")return structuredClone(J);return JSON.parse(JSON.stringify(J))}function c6(J,$={}){let{capacity:Q=1/0,deep:G=!1,clone:Z=!1}=$,K=W9([{snapshot:ZJ(J.value,Z),timestamp:Date.now()}]),q=W9([]),z=!1,M=SJ(()=>K.value.length>1),B=SJ(()=>q.value.length>0),W=SJ(()=>{return K.value[K.value.length-1]});function X(){let F={snapshot:ZJ(J.value,Z),timestamp:Date.now()};if(K.value=[...K.value,F],Q!==1/0&&K.value.length>Q)K.value=K.value.slice(K.value.length-Q);q.value=[]}function _(){if(K.value.length<=1)return;z=!0;let F=K.value[K.value.length-1],O=K.value.slice(0,-1);if(K.value=O,F)q.value=[...q.value,F];let P=O[O.length-1];if(P)J.value=ZJ(P.snapshot,Z);z=!1}function Y(){if(q.value.length===0)return;z=!0;let F=q.value[q.value.length-1];if(q.value=q.value.slice(0,-1),F)K.value=[...K.value,F],J.value=ZJ(F.snapshot,Z);z=!1}function H(){K.value=[{snapshot:ZJ(J.value,Z),timestamp:Date.now()}],q.value=[]}return u6(J,()=>{if(!z)X()},{deep:G}),{history:K,commit:X,undo:_,redo:Y,canUndo:M,canRedo:B,clear:H,last:W}}import{watch as l6}from"@stacksjs/stx";function i6(J,$){let Q=$?.debounce??200,{history:G,commit:Z,undo:K,redo:q,canUndo:z,canRedo:M,clear:B,last:W}=QJ(J,$),X=null,_=!1;l6(J,()=>{if(_){_=!1;return}if(X!==null)clearTimeout(X);X=setTimeout(()=>{X=null,Z()},Q)});let Y=K,H=q;function F(){if(X!==null)clearTimeout(X),X=null;_=!0,Y()}function O(){if(X!==null)clearTimeout(X),X=null;_=!0,H()}return{history:G,commit:Z,undo:F,redo:O,canUndo:z,canRedo:M,clear:B,last:W}}import{watch as r6}from"@stacksjs/stx";function s6(J,$){let Q=$?.throttle??200,{history:G,commit:Z,undo:K,redo:q,canUndo:z,canRedo:M,clear:B,last:W}=QJ(J,$),X=0,_=null,Y=!1;r6(J,()=>{if(Y){Y=!1;return}let C=Date.now();if(C-X>=Q)X=C,Z();else{if(_!==null)clearTimeout(_);_=setTimeout(()=>{_=null,X=Date.now(),Z()},Q-(C-X))}});let H=K,F=q;function O(){if(_!==null)clearTimeout(_),_=null;Y=!0,H()}function P(){if(_!==null)clearTimeout(_),_=null;Y=!0,F()}return{history:G,commit:Z,undo:O,redo:P,canUndo:z,canRedo:M,clear:B,last:W}}import{ref as XJ}from"@stacksjs/stx";function n6(J,$,Q={}){let{immediate:G=!0,onError:Z,resetOnExecute:K=!0,delay:q=0}=Q,z=XJ($),M=XJ(!1),B=XJ(!1),W=XJ(void 0);async function X(_){let Y=_??q;if(K)z.value=$;if(W.value=void 0,M.value=!1,B.value=!0,Y>0)await new Promise((H)=>setTimeout(H,Y));try{let H=typeof J==="function"?await J():await J;return z.value=H,M.value=!0,H}catch(H){if(W.value=H,Z)Z(H);return z.value}finally{B.value=!1}}if(G)X();return{state:z,isReady:M,isLoading:B,error:W,execute:X}}import{ref as xJ}from"@stacksjs/stx";function o6(J){let $=xJ(-1),Q=xJ(!1),G=xJ(J.map(()=>({state:"pending"})));async function Z(){for(let K=0;K<J.length;K++){$.value=K;let q=J[K];if(!q)continue;try{let z=await q();G.value=G.value.map((M,B)=>B===K?{state:"fulfilled",data:z}:M)}catch(z){G.value=G.value.map((M,B)=>B===K?{state:"rejected",data:z}:M)}}$.value=J.length,Q.value=!0}return Z(),{activeIndex:$,result:G,isFinished:Q}}import{watch as a6}from"@stacksjs/stx";function t6(J,$){return a6(J,(G)=>{if(G)$(G)})}import{watch as e6}from"@stacksjs/stx";function J8(J,$){let Q=!1,G=e6(J,(Z)=>{if(Q)return;Q=!0,G(),$(Z)});return()=>{if(!Q)Q=!0,G()}}import{watch as $8}from"@stacksjs/stx";function _9(J,$,Q){let G=Q?.debounce??200,Z=null,K=$8(J,(q)=>{if(Z!==null)clearTimeout(Z);Z=setTimeout(()=>{Z=null,$(q)},G)});return()=>{if(Z!==null)clearTimeout(Z),Z=null;K()}}import{watch as Q8}from"@stacksjs/stx";function Y9(J,$,Q){let G=Q?.throttle??200,Z=0,K=null,q,z=!1,M=Q8(J,(B)=>{let W=Date.now(),X=W-Z;if(X>=G){if(Z=W,K!==null)clearTimeout(K),K=null;z=!1,$(B)}else if(q=B,z=!0,K===null)K=setTimeout(()=>{if(Z=Date.now(),K=null,z)z=!1,$(q)},G-X)});return()=>{if(K!==null)clearTimeout(K),K=null;z=!1,M()}}import{ref as Z8,watch as G8}from"@stacksjs/stx";function H9(J,$){let Q=Z8(!0),G,Z=G8(J,(z)=>{if(Q.value)$(z,G);G=z});function K(){Q.value=!1}function q(){Q.value=!0}return{stop:Z,pause:K,resume:q,isActive:Q}}var K8=H9;import{ref as q8,watch as z8}from"@stacksjs/stx";function F9(J,$){let Q=q8(!1),G,Z=z8(J,(q)=>{if(!Q.value)$(q,G);G=q});function K(q){Q.value=!0,q(),Promise.resolve().then(()=>{Q.value=!1})}return{stop:Z,ignoreUpdates:K,isIgnoring:Q}}var M8=F9;import{watch as B8}from"@stacksjs/stx";function X8(J,$){let Q=[...J.value];return B8(J,(Z)=>{let K=[...Z],q=K.filter((M)=>!Q.includes(M)),z=Q.filter((M)=>!K.includes(M));$(K,Q,q,z),Q=K})}import{ref as W8,watch as _8}from"@stacksjs/stx";function Y8(J,$,Q){let G=W8(Q),Z=_8(J,(K)=>{if(G.value>0){if(G.value--,$(K),G.value<=0)Z()}});return{stop:Z,remaining:G}}import{watch as H8}from"@stacksjs/stx";function F8(J,$,Q){let G=JSON.stringify(J.value);if(Q?.immediate)$(J.value);return H8(J,(K)=>{let q=JSON.stringify(K);if(q!==G)G=q,$(K)})}import{watch as L8}from"@stacksjs/stx";function O8(J,$){return $(J.value),L8(J,(Q)=>{$(Q)})}import{watch as A8}from"@stacksjs/stx";function N8(J,$){let Q=A8(J,(Z)=>{$(Z)});function G(){$(J.value)}return{stop:Q,trigger:G}}import{watch as P8}from"@stacksjs/stx";function D8(J,$,Q){return P8(J,(Z)=>{Q(()=>$(Z))})}import{onUnmounted as C8,ref as yJ}from"@stacksjs/stx";function E8(J,$={}){let{onConnected:Q,onDisconnected:G,onError:Z,onMessage:K,immediate:q=!0,autoReconnect:z=!1,heartbeat:M=!1,protocols:B}=$,W=yJ(null),X=yJ("CLOSED"),_=yJ(null),Y=0,H=null,F=null,O=!1,P=typeof M==="object"?M.interval??30000:30000,C=typeof M==="object"?M.message??"ping":"ping",E=typeof z==="object"?z.retries??3:z?1/0:0,b=typeof z==="object"?z.delay??1000:1000;function u(S){if(c(),!M)return;F=setInterval(()=>{if(S.readyState===WebSocket.OPEN)S.send(C)},P)}function c(){if(F!==null)clearInterval(F),F=null}function l(){if(typeof WebSocket>"u")return;r(),O=!1,Y=0;let S=T(J);X.value="CONNECTING";let D=B?new WebSocket(S,B):new WebSocket(S);_.value=D,D.onopen=()=>{X.value="OPEN",Y=0,u(D),Q?.(D)},D.onclose=(A)=>{if(X.value="CLOSED",_.value=null,c(),G?.(D,A),!O&&z&&Y<E)Y++,H=setTimeout(()=>{l()},b)},D.onerror=(A)=>{Z?.(D,A)},D.onmessage=(A)=>{W.value=typeof A.data==="string"?A.data:String(A.data),K?.(D,A)}}function r(S,D){if(O=!0,c(),H!==null)clearTimeout(H),H=null;let A=_.value;if(A){if(A.readyState===WebSocket.OPEN||A.readyState===WebSocket.CONNECTING)X.value="CLOSING",A.close(S,D);_.value=null}}function BJ(S){let D=_.value;if(D&&D.readyState===WebSocket.OPEN)D.send(S)}if(q)l();try{C8(()=>{r()})}catch{}return{data:W,status:X,ws:_,open:l,close:r,send:BJ}}import{onUnmounted as T8,ref as GJ}from"@stacksjs/stx";function V8(J,$=[],Q={}){let{withCredentials:G=!1,immediate:Z=!0}=Q,K=GJ(null),q=GJ(null),z=GJ("CLOSED"),M=GJ(null),B=GJ(null),W=[];function X(){let Y=B.value;if(Y){for(let{eventName:H,handler:F}of W)Y.removeEventListener(H,F);W=[],Y.close(),B.value=null,z.value="CLOSED"}}function _(){if(typeof EventSource>"u")return;X();let Y=T(J);z.value="CONNECTING";let H=new EventSource(Y,{withCredentials:G});B.value=H,H.onopen=()=>{z.value="OPEN",M.value=null},H.onerror=(O)=>{if(M.value=O,H.readyState===EventSource.CLOSED)z.value="CLOSED";else z.value="CONNECTING"};let F=(O)=>{let P=O;K.value=P.data,q.value="message"};H.addEventListener("message",F),W.push({eventName:"message",handler:F});for(let O of $){let P=(C)=>{let E=C;K.value=E.data,q.value=O};H.addEventListener(O,P),W.push({eventName:O,handler:P})}}if(Z)_();try{T8(()=>{X()})}catch{}return{data:K,event:q,status:z,error:M,eventSource:B,close:X,open:_}}import{onUnmounted as j8,ref as KJ}from"@stacksjs/stx";function U8(J){let $=KJ(typeof BroadcastChannel<"u"),Q=KJ(void 0),G=KJ(null),Z=KJ(null),K=KJ(!1);if($.value){let M=new BroadcastChannel(J);Q.value=M,M.onmessage=(B)=>{G.value=B.data},M.onmessageerror=(B)=>{Z.value=B};try{j8(()=>{M.close(),K.value=!0})}catch{}}function q(M){if(Q.value&&!K.value)Q.value.postMessage(M)}function z(){if(Q.value&&!K.value)Q.value.close(),K.value=!0}return{isSupported:$,channel:Q,data:G,error:Z,post:q,close:z,isClosed:K}}import{ref as R8,watch as I8}from"@stacksjs/stx";function L9(J,$,Q){let G=R8($),Z=0;async function K(){let q=++Z;try{let z=await J();if(q===Z)G.value=z}catch{}}if(K(),Q&&Q.length>0)for(let q of Q)I8(q,()=>{K()});return G}import{ref as b8,watch as S8}from"@stacksjs/stx";function O9(J,$){let Q=b8(J());if($&&$.length>0)for(let G of $)S8(G,()=>{Q.value=J()});return Q}import{onUnmounted as x8,ref as y8}from"@stacksjs/stx";function wJ(J,$,Q){let G=y8(typeof window<"u"&&"IntersectionObserver"in window),Z=N;(()=>{if(Z(),!G.value)return;let z=L(J);if(!z)return;let M=new IntersectionObserver($,Q);M.observe(z),Z=()=>{M.disconnect(),Z=N}})();let q=()=>{Z()};try{x8(q)}catch{}return{isSupported:G,stop:q}}import{onUnmounted as w8,ref as k8}from"@stacksjs/stx";function g8(J,$,Q){let G=k8(typeof window<"u"&&"ResizeObserver"in window),Z=N;(()=>{if(Z(),!G.value)return;let z=L(J);if(!z)return;let M=new ResizeObserver($);M.observe(z,Q),Z=()=>{M.disconnect(),Z=N}})();let q=()=>{Z()};try{w8(q)}catch{}return{isSupported:G,stop:q}}import{onUnmounted as h8,ref as v8}from"@stacksjs/stx";function f8(J,$,Q){let G=v8(typeof window<"u"&&"MutationObserver"in window),Z=N;(()=>{if(Z(),!G.value)return;let z=L(J);if(!z)return;let M=new MutationObserver($);M.observe(z,Q??{childList:!0,subtree:!0}),Z=()=>{M.disconnect(),Z=N}})();let q=()=>{Z()};try{h8(q)}catch{}return{isSupported:G,stop:q}}import{onUnmounted as m8,ref as A9}from"@stacksjs/stx";function p8(J,$){let Q=A9($?.initialSize?.width??0),G=A9($?.initialSize?.height??0),Z=typeof window<"u"&&"ResizeObserver"in window,K=N;if(Z){let z=L(J);if(z){let M=new ResizeObserver((B)=>{for(let W of B)if(W.contentBoxSize){let X=Array.isArray(W.contentBoxSize)?W.contentBoxSize[0]:W.contentBoxSize;Q.value=X.inlineSize,G.value=X.blockSize}else Q.value=W.contentRect.width,G.value=W.contentRect.height});M.observe(z),K=()=>{M.disconnect(),K=N}}}let q=()=>{K()};try{m8(q)}catch{}return{width:Q,height:G,stop:q}}import{onUnmounted as d8,ref as p}from"@stacksjs/stx";function u8(J){let $=p(0),Q=p(0),G=p(0),Z=p(0),K=p(0),q=p(0),z=p(0),M=p(0),B=[],W=N,X=()=>{let _=L(J);if(!_)return;let Y=_.getBoundingClientRect();$.value=Y.x,Q.value=Y.y,G.value=Y.top,Z.value=Y.right,K.value=Y.bottom,q.value=Y.left,z.value=Y.width,M.value=Y.height};if(typeof window<"u"){X();let _=()=>X();window.addEventListener("resize",_,{passive:!0}),B.push(()=>window.removeEventListener("resize",_));let Y=()=>X();if(window.addEventListener("scroll",Y,{passive:!0}),B.push(()=>window.removeEventListener("scroll",Y)),"ResizeObserver"in window){let H=L(J);if(H){let F=new ResizeObserver(X);F.observe(H),B.push(()=>F.disconnect())}}if("MutationObserver"in window){let H=L(J);if(H){let F=new MutationObserver(X);F.observe(H,{childList:!0,subtree:!0,attributes:!0}),B.push(()=>F.disconnect())}}W=()=>{for(let H of B)H();B.length=0,W=N}}try{d8(()=>W())}catch{}return{x:$,y:Q,top:G,right:Z,bottom:K,left:q,width:z,height:M,update:X}}import{ref as c8}from"@stacksjs/stx";function l8(J){let $=c8(!1);return wJ(J,(Q)=>{for(let G of Q)$.value=G.isIntersecting},{threshold:0}),$}import{onUnmounted as i8,ref as r8}from"@stacksjs/stx";function s8(J){let $=r8(!1),Q=()=>{};function G(Z){if(Q(),!Z)return;let K=()=>{$.value=!0},q=()=>{$.value=!1};Z.addEventListener("mouseenter",K,{passive:!0}),Z.addEventListener("mouseleave",q,{passive:!0}),Q=()=>{Z.removeEventListener("mouseenter",K),Z.removeEventListener("mouseleave",q),Q=()=>{}}}G(L(J));try{i8(()=>Q())}catch{}return $}import{onUnmounted as n8,ref as kJ}from"@stacksjs/stx";function o8(J){let $=J?.x??kJ(0),Q=J?.y??kJ(0),G=kJ(null);if(typeof document>"u")return{element:G,x:$,y:Q};let Z=(K)=>{$.value=K.clientX,Q.value=K.clientY,G.value=document.elementFromPoint(K.clientX,K.clientY)};document.addEventListener("mousemove",Z,{passive:!0});try{n8(()=>{document.removeEventListener("mousemove",Z)})}catch{}return{element:G,x:$,y:Q}}import{ref as a8,watch as t8}from"@stacksjs/stx";function e8(J,$,Q){let G=a8(Q??""),Z=()=>{let q=L($);if(q)return q;if(typeof document<"u")return document.documentElement;return null},K=Z();if(K){let q=getComputedStyle(K).getPropertyValue(L(J)).trim();if(q)G.value=q}return t8(G,(q)=>{let z=Z();if(z)z.style.setProperty(L(J),q)}),G}function J2(J){let $=L(J);if(!$)return $;if($.$el)return $.$el;return $}import{onUnmounted as $2,ref as gJ}from"@stacksjs/stx";function Q2(J){let $=J?.type??"page",Q=J?.touch??!0,G=J?.initialValue??{x:0,y:0},Z=gJ(G.x),K=gJ(G.y),q=gJ(null),z=N;if(typeof window<"u"){let M=[],B=(X)=>{switch($){case"page":return{x:X.pageX,y:X.pageY};case"client":return{x:X.clientX,y:X.clientY};case"screen":return{x:X.screenX,y:X.screenY};default:return{x:X.pageX,y:X.pageY}}},W=(X)=>{let _=B(X);Z.value=_.x,K.value=_.y,q.value="mouse"};if(window.addEventListener("mousemove",W,{passive:!0}),M.push(()=>window.removeEventListener("mousemove",W)),Q){let X=(_)=>{if(_.touches.length>0){let Y=_.touches[0];if(!Y)return;switch($){case"page":Z.value=Y.pageX,K.value=Y.pageY;break;case"client":Z.value=Y.clientX,K.value=Y.clientY;break;case"screen":Z.value=Y.screenX,K.value=Y.screenY;break}q.value="touch"}};window.addEventListener("touchstart",X,{passive:!0}),window.addEventListener("touchmove",X,{passive:!0}),M.push(()=>{window.removeEventListener("touchstart",X),window.removeEventListener("touchmove",X)})}z=()=>{for(let X of M)X();M.length=0,z=N}}try{$2(()=>z())}catch{}return{x:Z,y:K,sourceType:q}}import{onUnmounted as Z2,ref as m}from"@stacksjs/stx";function G2(J){let $=m(0),Q=m(0),G=m(0),Z=m(0),K=m(0),q=m(0),z=m(0),M=m(0),B=m(!0);if(typeof window>"u")return{x:$,y:Q,elementX:G,elementY:Z,elementPositionX:K,elementPositionY:q,elementHeight:z,elementWidth:M,isOutside:B};let W=(X)=>{$.value=X.pageX,Q.value=X.pageY;let _=L(J);if(!_){B.value=!0;return}let Y=_.getBoundingClientRect();K.value=Y.left+window.scrollX,q.value=Y.top+window.scrollY,z.value=Y.height,M.value=Y.width,G.value=X.pageX-K.value,Z.value=X.pageY-q.value,B.value=G.value<0||Z.value<0||G.value>M.value||Z.value>z.value};window.addEventListener("mousemove",W,{passive:!0});try{Z2(()=>{window.removeEventListener("mousemove",W)})}catch{}return{x:$,y:Q,elementX:G,elementY:Z,elementPositionX:K,elementPositionY:q,elementHeight:z,elementWidth:M,isOutside:B}}import{onUnmounted as K2,ref as N9}from"@stacksjs/stx";function q2(J){let $=N9(!1),Q=N9(null);if(typeof window>"u")return{pressed:$,sourceType:Q};let G=L(J)??window,Z=()=>{$.value=!0,Q.value="mouse"},K=()=>{$.value=!0,Q.value="touch"},q=()=>{$.value=!1};G.addEventListener("mousedown",Z,{passive:!0}),G.addEventListener("touchstart",K,{passive:!0}),window.addEventListener("mouseup",q,{passive:!0}),window.addEventListener("touchend",q,{passive:!0}),window.addEventListener("touchcancel",q,{passive:!0});try{K2(()=>{G.removeEventListener("mousedown",Z),G.removeEventListener("touchstart",K),window.removeEventListener("mouseup",q),window.removeEventListener("touchend",q),window.removeEventListener("touchcancel",q)})}catch{}return{pressed:$,sourceType:Q}}import{onUnmounted as z2,ref as d}from"@stacksjs/stx";function M2(J){let $=d(0),Q=d(0),G=d(0),Z=d(0),K=d(0),q=d(0),z=d(""),M=d(!1);if(typeof window>"u")return{isInside:M,x:$,y:Q,pointerId:G,pressure:Z,tiltX:K,tiltY:q,pointerType:z};let B=J??window,W=(Y)=>{$.value=Y.pageX,Q.value=Y.pageY,G.value=Y.pointerId,Z.value=Y.pressure,K.value=Y.tiltX,q.value=Y.tiltY,z.value=Y.pointerType},X=()=>{M.value=!0},_=()=>{M.value=!1};B.addEventListener("pointermove",W,{passive:!0}),B.addEventListener("pointerdown",W,{passive:!0}),B.addEventListener("pointerenter",X,{passive:!0}),B.addEventListener("pointerleave",_,{passive:!0});try{z2(()=>{B.removeEventListener("pointermove",W),B.removeEventListener("pointerdown",W),B.removeEventListener("pointerenter",X),B.removeEventListener("pointerleave",_)})}catch{}return{isInside:M,x:$,y:Q,pointerId:G,pressure:Z,tiltX:K,tiltY:q,pointerType:z}}import{onUnmounted as B2,ref as WJ}from"@stacksjs/stx";function X2(J,$={}){let{threshold:Q=50,onSwipe:G,onSwipeStart:Z,onSwipeEnd:K,passive:q=!0}=$,z=WJ(!1),M=WJ("none"),B=WJ(0),W=WJ(0),X=0,_=0;if(typeof window>"u")return{isSwiping:z,direction:M,lengthX:B,lengthY:W};let Y=L(J)??window,H=(P)=>{let C=P.touches[0];if(!C)return;X=C.clientX,_=C.clientY,z.value=!0,M.value="none",B.value=0,W.value=0,Z?.(P)},F=(P)=>{if(!z.value)return;let C=P.touches[0];if(!C)return;B.value=C.clientX-X,W.value=C.clientY-_;let E=Math.abs(B.value),b=Math.abs(W.value);if(E>b)M.value=B.value>0?"right":"left";else if(b>E)M.value=W.value>0?"down":"up"},O=(P)=>{if(!z.value)return;z.value=!1;let C=Math.abs(B.value),E=Math.abs(W.value);if(Math.max(C,E)>=Q)G?.(M.value),K?.(P,M.value);else M.value="none",K?.(P,"none")};Y.addEventListener("touchstart",H,{passive:q}),Y.addEventListener("touchmove",F,{passive:q}),Y.addEventListener("touchend",O,{passive:q}),Y.addEventListener("touchcancel",O,{passive:q});try{B2(()=>{Y.removeEventListener("touchstart",H),Y.removeEventListener("touchmove",F),Y.removeEventListener("touchend",O),Y.removeEventListener("touchcancel",O)})}catch{}return{isSwiping:z,direction:M,lengthX:B,lengthY:W}}import{onUnmounted as W2,ref as n}from"@stacksjs/stx";function _2(J,$={}){let{threshold:Q=50,onSwipe:G,onSwipeEnd:Z}=$,K=n(!1),q=n("none"),z=n(0),M=n(0),B=n({x:0,y:0}),W=n({x:0,y:0});if(typeof window>"u")return{isSwiping:K,direction:q,distanceX:z,distanceY:M,posStart:B,posEnd:W};let X=L(J);if(!X)return{isSwiping:K,direction:q,distanceX:z,distanceY:M,posStart:B,posEnd:W};let _=(F)=>{K.value=!0,q.value="none",B.value={x:F.clientX,y:F.clientY},W.value={x:F.clientX,y:F.clientY},z.value=0,M.value=0,X.setPointerCapture(F.pointerId)},Y=(F)=>{if(!K.value)return;W.value={x:F.clientX,y:F.clientY},z.value=W.value.x-B.value.x,M.value=W.value.y-B.value.y;let O=Math.abs(z.value),P=Math.abs(M.value);if(O>P)q.value=z.value>0?"right":"left";else if(P>O)q.value=M.value>0?"down":"up"},H=(F)=>{if(!K.value)return;if(K.value=!1,Math.max(Math.abs(z.value),Math.abs(M.value))>=Q)G?.(q.value),Z?.(F,q.value);else q.value="none",Z?.(F,"none")};X.addEventListener("pointerdown",_),X.addEventListener("pointermove",Y),X.addEventListener("pointerup",H);try{W2(()=>{X.removeEventListener("pointerdown",_),X.removeEventListener("pointermove",Y),X.removeEventListener("pointerup",H)})}catch{}return{isSwiping:K,direction:q,distanceX:z,distanceY:M,posStart:B,posEnd:W}}import{onUnmounted as Y2,ref as hJ}from"@stacksjs/stx";function H2(J){let $=hJ(typeof document<"u"&&"pointerLockElement"in document),Q=hJ(!1),G=hJ(null);if(typeof document<"u"){let q=()=>{Q.value=!!document.pointerLockElement,G.value=document.pointerLockElement};document.addEventListener("pointerlockchange",q),document.addEventListener("pointerlockerror",q);try{Y2(()=>{document.removeEventListener("pointerlockchange",q),document.removeEventListener("pointerlockerror",q)})}catch{}}async function Z(q){if(!$.value)return;let z=q??L(J);if(z)await z.requestPointerLock()}function K(){if(!$.value)return;if(document.pointerLockElement)document.exitPointerLock()}return{isSupported:$,isLocked:Q,lock:Z,unlock:K,element:G}}import{onUnmounted as F2,ref as vJ}from"@stacksjs/stx";function L2(J,$={}){let Q=vJ(0),G=vJ(0),Z=vJ("mouse");if(typeof window>"u")return{tilt:Q,roll:G,source:Z};let K=(z)=>{let M=L(J);if(!M)return;let B=M.getBoundingClientRect(),W=B.left+B.width/2,X=B.top+B.height/2;Q.value=(z.clientX-W)/(B.width/2)*0.5,G.value=(z.clientY-X)/(B.height/2)*0.5,Z.value="mouse"};window.addEventListener("mousemove",K,{passive:!0});let q=(z)=>{if(z.gamma!==null&&z.beta!==null){let M=z.gamma/90,B=(z.beta-45)/90;Q.value=$.deviceOrientationTiltAdjust?.(M)??M*0.5,G.value=$.deviceOrientationRollAdjust?.(B)??B*0.5,Z.value="deviceOrientation"}};window.addEventListener("deviceorientation",q,{passive:!0});try{F2(()=>{window.removeEventListener("mousemove",K),window.removeEventListener("deviceorientation",q)})}catch{}return{tilt:Q,roll:G,source:Z}}import{onUnmounted as O2,ref as h}from"@stacksjs/stx";function A2(J){let{immediate:$=!0,...Q}=J??{},G=h(typeof navigator<"u"&&"geolocation"in navigator),Z={latitude:h(null),longitude:h(null),accuracy:h(null),altitude:h(null),altitudeAccuracy:h(null),heading:h(null),speed:h(null)},K=h(null),q=h(null),z=null,M=N,B=(Y)=>{Z.latitude.value=Y.coords.latitude,Z.longitude.value=Y.coords.longitude,Z.accuracy.value=Y.coords.accuracy,Z.altitude.value=Y.coords.altitude,Z.altitudeAccuracy.value=Y.coords.altitudeAccuracy,Z.heading.value=Y.coords.heading,Z.speed.value=Y.coords.speed,K.value=Y.timestamp,q.value=null},W=(Y)=>{q.value=Y},X=()=>{if(!G.value)return;if(z!==null)return;z=navigator.geolocation.watchPosition(B,W,Q),M=()=>{if(z!==null)navigator.geolocation.clearWatch(z),z=null;M=N}},_=()=>{M()};if($)X();try{O2(_)}catch{}return{coords:Z,locatedAt:K,error:q,isSupported:G,pause:_,resume:X}}import{onUnmounted as N2,ref as y}from"@stacksjs/stx";function P2(){let J=y(typeof window<"u"&&"DeviceMotionEvent"in window),$={x:y(null),y:y(null),z:y(null)},Q={x:y(null),y:y(null),z:y(null)},G={alpha:y(null),beta:y(null),gamma:y(null)},Z=y(0),K=N;if(typeof window<"u"&&J.value){let q=(z)=>{if(z.acceleration)$.x.value=z.acceleration.x,$.y.value=z.acceleration.y,$.z.value=z.acceleration.z;if(z.accelerationIncludingGravity)Q.x.value=z.accelerationIncludingGravity.x,Q.y.value=z.accelerationIncludingGravity.y,Q.z.value=z.accelerationIncludingGravity.z;if(z.rotationRate)G.alpha.value=z.rotationRate.alpha,G.beta.value=z.rotationRate.beta,G.gamma.value=z.rotationRate.gamma;Z.value=z.interval};window.addEventListener("devicemotion",q,{passive:!0}),K=()=>{window.removeEventListener("devicemotion",q),K=N}}try{N2(()=>K())}catch{}return{acceleration:$,accelerationIncludingGravity:Q,rotationRate:G,interval:Z,isSupported:J}}import{onUnmounted as D2,ref as qJ}from"@stacksjs/stx";function C2(){let J=qJ(typeof window<"u"&&"DeviceOrientationEvent"in window),$=qJ(null),Q=qJ(null),G=qJ(null),Z=qJ(!1),K=N;if(typeof window<"u"&&J.value){let q=(z)=>{$.value=z.alpha,Q.value=z.beta,G.value=z.gamma,Z.value=z.absolute};window.addEventListener("deviceorientation",q,{passive:!0}),K=()=>{window.removeEventListener("deviceorientation",q),K=N}}try{D2(()=>K())}catch{}return{alpha:$,beta:Q,gamma:G,absolute:Z,isSupported:J}}import{onUnmounted as E2,ref as T2}from"@stacksjs/stx";function V2(){let J=T2(typeof window<"u"?window.devicePixelRatio:1);if(typeof window>"u")return{pixelRatio:J};let $=null,Q=()=>{};function G(){Q(),$=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);let Z=()=>{J.value=window.devicePixelRatio,G()};$.addEventListener("change",Z,{once:!0}),Q=()=>{$?.removeEventListener("change",Z)}}G();try{E2(()=>Q())}catch{}return{pixelRatio:J}}import{onUnmounted as j2,ref as zJ}from"@stacksjs/stx";function U2(){let J=typeof navigator<"u"?navigator:void 0,$=zJ(!!J?.getBattery),Q=zJ(!1),G=zJ(0),Z=zJ(0),K=zJ(1),q=[],z=N;if($.value&&J?.getBattery)J.getBattery().then((M)=>{let B=()=>{Q.value=M.charging,G.value=M.chargingTime,Z.value=M.dischargingTime,K.value=M.level};B(),M.addEventListener("chargingchange",B),M.addEventListener("chargingtimechange",B),M.addEventListener("dischargingtimechange",B),M.addEventListener("levelchange",B),q.push(()=>{M.removeEventListener("chargingchange",B),M.removeEventListener("chargingtimechange",B),M.removeEventListener("dischargingtimechange",B),M.removeEventListener("levelchange",B)}),z=()=>{for(let W of q)W();q.length=0,z=N}}).catch(()=>{$.value=!1});try{j2(()=>z())}catch{}return{charging:Q,chargingTime:G,dischargingTime:Z,level:K,isSupported:$}}import{onUnmounted as R2,ref as I2,watch as b2}from"@stacksjs/stx";function S2(J,$={}){let{initialValue:Q=!1}=$,G=I2(Q),Z=()=>{};function K(z){if(Z(),!z)return;let M=()=>{G.value=!0},B=()=>{G.value=!1};if(z.addEventListener("focus",M,{passive:!0}),z.addEventListener("blur",B,{passive:!0}),Z=()=>{z.removeEventListener("focus",M),z.removeEventListener("blur",B),Z=()=>{}},document.activeElement===z)G.value=!0;if(Q)z.focus()}let q=L(J);K(q),b2(G,(z)=>{let M=L(J);if(!M)return;if(z)M.focus();else M.blur()});try{R2(()=>Z())}catch{}return{focused:G}}import{onUnmounted as x2,ref as y2}from"@stacksjs/stx";function w2(J){let $=y2(!1),Q=()=>{};function G(Z){if(Q(),!Z)return;let K=()=>{$.value=!0},q=(z)=>{if(!Z.contains(z.relatedTarget))$.value=!1};Z.addEventListener("focusin",K,{passive:!0}),Z.addEventListener("focusout",q),Q=()=>{Z.removeEventListener("focusin",K),Z.removeEventListener("focusout",q),Q=()=>{}}}G(L(J));try{x2(()=>Q())}catch{}return{focused:$}}import{onUnmounted as k2,ref as g2}from"@stacksjs/stx";function h2(){let J=g2(null);if(typeof document>"u")return J;J.value=document.activeElement;let $=()=>{J.value=document.activeElement};document.addEventListener("focusin",$,{passive:!0}),document.addEventListener("focusout",$,{passive:!0});try{k2(()=>{document.removeEventListener("focusin",$),document.removeEventListener("focusout",$)})}catch{}return J}import{onUnmounted as v2,ref as P9}from"@stacksjs/stx";var f2=["mousemove","mousedown","resize","keydown","touchstart","wheel"];function m2(J=60000,$){let Q=$?.events??f2,G=$?.initialState??!1,Z=P9(G),K=P9(Date.now()),q=null,z=N;if(typeof window<"u"){let M=[],B=()=>{if(Z.value=!1,K.value=Date.now(),q!==null)clearTimeout(q);q=setTimeout(()=>{Z.value=!0},J)};for(let W of Q)window.addEventListener(W,B,{passive:!0}),M.push(()=>window.removeEventListener(W,B));q=setTimeout(()=>{Z.value=!0},J),z=()=>{for(let W of M)W();if(M.length=0,q!==null)clearTimeout(q),q=null;z=N}}try{v2(()=>z())}catch{}return{idle:Z,lastActive:K}}import{onUnmounted as p2,ref as d2}from"@stacksjs/stx";function u2(){let J=d2(!1),$=N;if(typeof document<"u"){let Q=[],G=(K)=>{if(K.clientY<=0||K.clientX<=0||K.clientX>=(typeof window<"u"?window.innerWidth:0)||K.clientY>=(typeof window<"u"?window.innerHeight:0))J.value=!0},Z=()=>{J.value=!1};document.documentElement.addEventListener("mouseleave",G),document.documentElement.addEventListener("mouseenter",Z),Q.push(()=>document.documentElement.removeEventListener("mouseleave",G),()=>document.documentElement.removeEventListener("mouseenter",Z)),$=()=>{for(let K of Q)K();Q.length=0,$=N}}try{p2(()=>$())}catch{}return J}import{ref as c2}from"@stacksjs/stx";function l2(){let J=c2(!1);return Promise.resolve().then(()=>{J.value=!0}),J}import{onUnmounted as i2,ref as _J}from"@stacksjs/stx";function r2(J,$){let Q=$?.initialValue?.x??0,G=$?.initialValue?.y??0,Z=_J(Q),K=_J(G),q=_J(!1),z=_J(`left: ${Q}px; top: ${G}px;`),M=N;if(typeof window<"u"){let B=[],W=0,X=0,_=0,Y=0,H=()=>{z.value=`left: ${Z.value}px; top: ${K.value}px;`},F=(E)=>{if(!q.value)return;if(Z.value=E.clientX-_,K.value=E.clientY-Y,H(),$?.onMove)$.onMove({x:Z.value,y:K.value},E)},O=(E)=>{if(!q.value)return;if(q.value=!1,$?.onEnd)$.onEnd({x:Z.value,y:K.value},E);window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",O)},P=(E)=>{let b={x:Z.value,y:K.value};if($?.onStart){if($.onStart(b,E)===!1)return}W=E.clientX,X=E.clientY,_=W-Z.value,Y=X-K.value,q.value=!0,window.addEventListener("pointermove",F),window.addEventListener("pointerup",O)},C=L(J);if(C)C.addEventListener("pointerdown",P),B.push(()=>C.removeEventListener("pointerdown",P));M=()=>{for(let E of B)E();B.length=0,window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",O),M=N}}try{i2(()=>M())}catch{}return{x:Z,y:K,isDragging:q,style:z}}import{onUnmounted as s2,ref as D9}from"@stacksjs/stx";function n2(J,$){let Q=D9(!1),G=D9(null),Z=N,K=0;if(typeof window<"u"){let q=L(J);if(q){let z=[],M=(_)=>{_.preventDefault(),K++,Q.value=!0},B=(_)=>{_.preventDefault(),Q.value=!0},W=(_)=>{if(_.preventDefault(),K--,K<=0)K=0,Q.value=!1},X=(_)=>{_.preventDefault(),K=0,Q.value=!1;let Y=_.dataTransfer?.files;if(Y&&Y.length>0)G.value=Array.from(Y);else G.value=null;if($)$(G.value)};q.addEventListener("dragenter",M),q.addEventListener("dragover",B),q.addEventListener("dragleave",W),q.addEventListener("drop",X),z.push(()=>q.removeEventListener("dragenter",M),()=>q.removeEventListener("dragover",B),()=>q.removeEventListener("dragleave",W),()=>q.removeEventListener("drop",X)),Z=()=>{for(let _ of z)_();z.length=0,Z=N}}}try{s2(()=>Z())}catch{}return{isOverDropZone:Q,files:G}}import{onUnmounted as o2,ref as C9}from"@stacksjs/stx";function a2(){let J=C9(typeof navigator<"u"&&"language"in navigator),$=C9(J.value?navigator.language:"");if(typeof window<"u"){let Q=()=>{if(J.value)$.value=navigator.language};window.addEventListener("languagechange",Q,{passive:!0});try{o2(()=>{window.removeEventListener("languagechange",Q)})}catch{}}return{language:$,isSupported:J}}import{onUnmounted as t2,ref as e2}from"@stacksjs/stx";function J7(){let J=e2(typeof navigator<"u"?navigator.languages:[]);if(typeof window>"u")return J;let $=()=>{J.value=navigator.languages};window.addEventListener("languagechange",$,{passive:!0});try{t2(()=>{window.removeEventListener("languagechange",$)})}catch{}return J}import{onUnmounted as $7,ref as fJ}from"@stacksjs/stx";function Q7(){let J=fJ(typeof screen<"u"&&"orientation"in screen),$=fJ(void 0),Q=fJ(0);if(J.value){$.value=screen.orientation.type,Q.value=screen.orientation.angle;let K=()=>{$.value=screen.orientation.type,Q.value=screen.orientation.angle};screen.orientation.addEventListener("change",K);try{$7(()=>{screen.orientation.removeEventListener("change",K)})}catch{}}async function G(K){if(J.value)await screen.orientation.lock(K)}function Z(){if(J.value)screen.orientation.unlock()}return{isSupported:J,orientation:$,angle:Q,lockOrientation:G,unlockOrientation:Z}}import{ref as YJ}from"@stacksjs/stx";function Z7(){let J=YJ("0px"),$=YJ("0px"),Q=YJ("0px"),G=YJ("0px");function Z(){if(typeof document>"u"||typeof getComputedStyle>"u")return;let K=document.createElement("div");K.style.position="fixed",K.style.top="env(safe-area-inset-top, 0px)",K.style.right="env(safe-area-inset-right, 0px)",K.style.bottom="env(safe-area-inset-bottom, 0px)",K.style.left="env(safe-area-inset-left, 0px)",K.style.pointerEvents="none",K.style.visibility="hidden",document.body.appendChild(K);let q=getComputedStyle(K);J.value=q.top,$.value=q.right,Q.value=q.bottom,G.value=q.left,document.body.removeChild(K)}return Z(),{top:J,right:$,bottom:Q,left:G,update:Z}}import{ref as G7}from"@stacksjs/stx";function K7(J){let $=G7(null),Q=L(J);if(Q)$.value=Q.parentElement;return $}import{onUnmounted as q7,ref as E9}from"@stacksjs/stx";function z7(J){let $=E9(typeof navigator<"u"&&"permissions"in navigator),Q=E9("prompt");if(!$.value)return{state:Q,isSupported:$};let G=null;return navigator.permissions.query({name:J}).then((Z)=>{G=Z,Q.value=Z.state;let K=()=>{Q.value=Z.state};Z.addEventListener("change",K);try{q7(()=>{Z.removeEventListener("change",K)})}catch{}}).catch(()=>{}),{state:Q,isSupported:$}}import{ref as M7}from"@stacksjs/stx";function B7(J={}){let $=M7(typeof navigator<"u"&&"share"in navigator);async function Q(G){if(!$.value)return;let Z={...J,...G};await navigator.share(Z)}return{share:Q,isSupported:$}}import{onUnmounted as X7,ref as W7,watch as _7}from"@stacksjs/stx";function Y7(J){let $=W7(void 0);function Q(){if($.value)URL.revokeObjectURL($.value),$.value=void 0}function G(Z){if(Q(),Z)$.value=URL.createObjectURL(Z)}G(J.value),_7(J,(Z)=>{G(Z)});try{X7(()=>Q())}catch{}return $}import{ref as mJ}from"@stacksjs/stx";function H7(J){let $=mJ(!0),Q=mJ(!1),G=mJ(null);if(typeof Image>"u")return $.value=!1,{isLoading:$,error:G,isReady:Q};let Z=new Image;if(Z.onload=()=>{$.value=!1,Q.value=!0},Z.onerror=(K)=>{if($.value=!1,typeof K==="string")G.value=K;else if(K instanceof Event&&K.type==="error")G.value=`Failed to load image: ${J.src}`;else G.value="Failed to load image"},J.crossorigin)Z.crossOrigin=J.crossorigin;if(J.referrerpolicy)Z.referrerPolicy=J.referrerpolicy;if(J.sizes)Z.sizes=J.sizes;if(J.srcset)Z.srcset=J.srcset;return Z.src=J.src,{isLoading:$,error:G,isReady:Q}}import{ref as F7,watch as L7}from"@stacksjs/stx";function O7(J){let $=F7("");async function Q(Z){if(typeof Z==="string"){if(typeof btoa<"u")return btoa(Z);return Buffer.from(Z).toString("base64")}if(Z instanceof ArrayBuffer){let K=new Uint8Array(Z),q="";for(let z of K)q+=String.fromCharCode(z);if(typeof btoa<"u")return btoa(q);return Buffer.from(Z).toString("base64")}if(typeof Blob<"u"&&Z instanceof Blob)return new Promise((K,q)=>{let z=new FileReader;z.onload=()=>{let M=z.result,B=M.split(",")[1]??M;K(B)},z.onerror=q,z.readAsDataURL(Z)});if(typeof HTMLCanvasElement<"u"&&Z instanceof HTMLCanvasElement)return Z.toDataURL().split(",")[1]??"";return""}async function G(){let Z=L(J),K=await Q(Z);return $.value=K,K}if(G().catch(()=>{}),j(J))L7(J,()=>{G().catch(()=>{})});return{base64:$,execute:G}}import{onUnmounted as A7,ref as MJ}from"@stacksjs/stx";function N7(J,$,Q){let G=MJ(typeof HTMLElement<"u"&&"animate"in HTMLElement.prototype),Z=MJ(void 0),K=MJ(!1),q=MJ("idle"),z=MJ(null);function M(){if(Z.value)K.value=Z.value.pending,q.value=Z.value.playState,z.value=Z.value.currentTime}function B(){let F=L(J);if(!F||!G.value)return;Z.value=F.animate($,Q),Z.value.addEventListener("finish",M),Z.value.addEventListener("cancel",M),M()}function W(){Z.value?.play(),M()}function X(){Z.value?.pause(),M()}function _(){Z.value?.reverse(),M()}function Y(){Z.value?.finish(),M()}function H(){Z.value?.cancel(),M()}B();try{A7(()=>{Z.value?.cancel()})}catch{}return{isSupported:G,animate:Z,play:W,pause:X,reverse:_,finish:Y,cancel:H,pending:K,playState:q,currentTime:z}}import{onUnmounted as P7,ref as D7,watch as C7}from"@stacksjs/stx";var pJ={linear:(J)=>J,easeInQuad:(J)=>J*J,easeOutQuad:(J)=>J*(2-J),easeInOutQuad:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J,easeInCubic:(J)=>J*J*J,easeOutCubic:(J)=>--J*J*J+1,easeInOutCubic:(J)=>J<0.5?4*J*J*J:(J-1)*(2*J-2)*(2*J-2)+1};function E7(J,$={}){let{duration:Q=300,transition:G=pJ.linear,delay:Z=0,onFinished:K,onStarted:q}=$,z=D7(L(J)),M=null;function B(W,X){if(M!==null)cancelAnimationFrame(M);let _=performance.now()+Z;q?.();function Y(H){let F=H-_;if(F<0){M=requestAnimationFrame(Y);return}let O=Math.min(F/Q,1),P=G(O);if(z.value=W+(X-W)*P,O<1)M=requestAnimationFrame(Y);else M=null,z.value=X,K?.()}M=requestAnimationFrame(Y)}if(typeof J==="object"&&J&&"value"in J&&"subscribe"in J)C7(J,(W)=>{if(typeof requestAnimationFrame<"u")B(z.value,W);else z.value=W});try{P7(()=>{if(M!==null)cancelAnimationFrame(M)})}catch{}return z}function T7(J,$,Q={}){return new Promise((G)=>{let{duration:Z=300,transition:K=pJ.linear,delay:q=0,onFinished:z,onStarted:M}=Q;if(typeof requestAnimationFrame>"u"){z?.(),G();return}let B=performance.now()+q;M?.();function W(X){let _=X-B;if(_<0){requestAnimationFrame(W);return}if(Math.min(_/Z,1)>=1)z?.(),G();else requestAnimationFrame(W)}requestAnimationFrame(W)})}import{onUnmounted as V7,ref as j7}from"@stacksjs/stx";function U7(J,$,Q={}){let{immediate:G=!0,type:Z="text/javascript",manual:K=!1,attrs:q={}}=Q,z=j7(null);function M(){return new Promise((W,X)=>{if(typeof document>"u"){X(Error("Document is not available"));return}let _=document.createElement("script");if(_.type=Z,_.src=J,Q.async)_.async=!0;if(Q.defer)_.defer=!0;if(Q.crossOrigin)_.crossOrigin=Q.crossOrigin;if(Q.referrerPolicy)_.referrerPolicy=Q.referrerPolicy;for(let[Y,H]of Object.entries(q))_.setAttribute(Y,H);_.addEventListener("load",()=>{z.value=_,$?.(_),W(_)}),_.addEventListener("error",(Y)=>{X(Y)}),document.head.appendChild(_)})}function B(){if(z.value)z.value.remove(),z.value=null}if(G)M();if(!K)try{V7(()=>B())}catch{}return{scriptTag:z,load:M,unload:B}}import{onUnmounted as R7,ref as T9,watch as I7}from"@stacksjs/stx";function b7(J,$={}){let{immediate:Q=!0,id:G=`style-${Math.random().toString(36).slice(2,9)}`,media:Z}=$,K=T9(J),q=T9(!1),z=null;function M(){if(typeof document>"u")return;if(z)return;if(z=document.createElement("style"),z.id=G,Z)z.media=Z;z.textContent=K.value,document.head.appendChild(z),q.value=!0}function B(){if(z)z.remove(),z=null,q.value=!1}if(I7(K,(W)=>{if(z)z.textContent=W}),Q)M();try{R7(()=>B())}catch{}return{id:G,css:K,load:M,unload:B,isLoaded:q}}import{ref as S7}from"@stacksjs/stx";function x7(){let J=S7(!1),$=JJ(),Q=JJ(),G=JJ(),Z=null;function K(M){return J.value=!0,G.trigger(M),new Promise((B)=>{Z=B})}function q(M){J.value=!1,$.trigger(M),Z?.({data:M,isCanceled:!1}),Z=null}function z(){J.value=!1,Q.trigger(void 0),Z?.({isCanceled:!0}),Z=null}return{isRevealed:J,reveal:K,confirm:q,cancel:z,onConfirm:$.on,onCancel:Q.on,onReveal:G.on}}import{ref as y7}from"@stacksjs/stx";function w7(J={}){let $=y7(null);function Q(Z){if(typeof document>"u")return;let K={...J,...Z},q=document.createElement("input");if(q.type="file",K.accept)q.accept=K.accept;if(K.multiple)q.multiple=!0;if(K.capture)q.setAttribute("capture",K.capture);q.onchange=()=>{$.value=q.files},q.click()}function G(){$.value=null}return{files:$,open:Q,reset:G}}import{ref as V9}from"@stacksjs/stx";function k7(){let J=V9(typeof window<"u"&&"EyeDropper"in window),$=V9("");async function Q(){if(!J.value)return;let G=new window.EyeDropper;try{let Z=await G.open();return $.value=Z.sRGBHex,Z}catch{return}}return{isSupported:J,sRGBHex:$,open:Q}}import{ref as j9,watch as g7}from"@stacksjs/stx";function h7(J){let $=j9(J?.element??null),Q=j9(J?.input??"");function G(){let Z=$.value;if(!Z)return;Z.style.height="auto",Z.style.height=`${Z.scrollHeight}px`}return g7(Q,()=>{if($.value)$.value.value=Q.value;if(typeof requestAnimationFrame<"u")requestAnimationFrame(G);else G()}),{textarea:$,input:Q,triggerResize:G}}import{onUnmounted as v7,ref as i}from"@stacksjs/stx";function f7(J={}){let $=i(typeof Notification<"u"),Q=i(null),G=i($.value&&Notification.permission==="granted"),Z=i(null),K=i(null),q=i(null),z=i(null);async function M(W){if(!$.value)return;if(Notification.permission!=="granted"){let H=await Notification.requestPermission();if(G.value=H==="granted",!G.value)return}let X={...J,...W},_=X.title??"",Y=new Notification(_,{body:X.body,icon:X.icon,dir:X.dir,lang:X.lang,tag:X.tag,requireInteraction:X.requireInteraction});return Q.value=Y,Y.onclick=(H)=>Z.value?.(H),Y.onshow=(H)=>K.value?.(H),Y.onerror=(H)=>q.value?.(H),Y.onclose=(H)=>{z.value?.(H),Q.value=null},Y}function B(){Q.value?.close(),Q.value=null}try{v7(()=>B())}catch{}return{isSupported:$,notification:Q,permissionGranted:G,show:M,close:B,onClick:Z,onShow:K,onError:q,onClose:z}}import{ref as m7}from"@stacksjs/stx";function p7(J={}){let{pattern:$=200}=J,Q=m7(typeof navigator<"u"&&"vibrate"in navigator);function G(K){if(!Q.value)return!1;return navigator.vibrate(K??$)}function Z(){if(Q.value)navigator.vibrate(0)}return{isSupported:Q,vibrate:G,stop:Z}}import{onUnmounted as d7,ref as U9}from"@stacksjs/stx";function u7(){let J=U9(typeof navigator<"u"&&"wakeLock"in navigator),$=U9(!1),Q=null;async function G(){if(!J.value)return;try{Q=await navigator.wakeLock.request("screen"),$.value=!0,Q.addEventListener("release",()=>{$.value=!1,Q=null})}catch{$.value=!1}}async function Z(){if(Q)await Q.release(),Q=null,$.value=!1}try{d7(()=>{Z()})}catch{}return{isSupported:J,isActive:$,request:G,release:Z}}import{onUnmounted as c7,ref as R9}from"@stacksjs/stx";function l7(J,$){let Q=R9(null),G=R9(void 0);if(typeof Worker<"u"){let q=new Worker(J,$);G.value=q,q.onmessage=(z)=>{Q.value=z.data};try{c7(()=>q.terminate())}catch{}}function Z(q){G.value?.postMessage(q)}function K(){G.value?.terminate(),G.value=void 0}return{data:Q,post:Z,terminate:K,worker:G}}function i7(J){let $;function Q(){let K=new Blob([`self.onmessage = function(e) { self.postMessage((${J.toString()})(...e.data)); }`],{type:"text/javascript"}),q=URL.createObjectURL(K);return new Worker(q)}function G(...K){return new Promise((q,z)=>{if(typeof Worker>"u"){try{q(J(...K))}catch(M){z(M)}return}$=Q(),$.onmessage=(M)=>{q(M.data),$?.terminate()},$.onerror=(M)=>{z(M),$?.terminate()},$.postMessage(K)})}function Z(){$?.terminate(),$=void 0}return{workerFn:G,terminate:Z}}import{ref as HJ,watch as r7}from"@stacksjs/stx";function s7(J,$){let{itemHeight:Q,overscan:G=5}=$,Z=HJ([]),K=HJ(0),q=HJ(0),z=HJ({style:{width:"100%",height:"0px",marginTop:"0px"}});function M(){return L(J)}function B(){let _=M(),Y=_.length*Q,H=Math.max(0,Math.floor(q.value/Q)-G),F=Math.min(_.length,Math.ceil((q.value+K.value)/Q)+G),O=[];for(let P=H;P<F;P++){let C=_[P];if(C===void 0&&!(P in _))continue;O.push({data:C,index:P})}Z.value=O,z.value={style:{width:"100%",height:`${Y-H*Q}px`,marginTop:`${H*Q}px`}}}let W=(_)=>{let Y=_.target;q.value=Y.scrollTop,K.value=Y.clientHeight,B()};if(B(),typeof J==="object"&&J&&"value"in J&&"subscribe"in J)r7(J,()=>B());function X(_){q.value=_*Q,B()}return{list:Z,containerProps:{onScroll:W,style:{overflow:"auto",position:"relative"}},wrapperProps:z,scrollTo:X}}import{ref as o,watch as dJ}from"@stacksjs/stx";function n7(J={}){let{total:$,pageSize:Q=10,page:G=1,onPageChange:Z,onPageSizeChange:K}=J,q=o(G),z=o(Q),M=typeof $==="object"&&$&&"value"in $?$:o(typeof $==="number"?$:0),B=o(Math.max(1,Math.ceil(M.value/z.value))),W=o(q.value<=1),X=o(q.value>=B.value);function _(){B.value=Math.max(1,Math.ceil(M.value/z.value)),W.value=q.value<=1,X.value=q.value>=B.value}dJ(q,()=>{_(),Z?.({currentPage:q.value,currentPageSize:z.value})}),dJ(z,()=>{q.value=1,_(),K?.({currentPage:q.value,currentPageSize:z.value})}),dJ(M,()=>{_()});function Y(){if(q.value>1)q.value--}function H(){if(q.value<B.value)q.value++}return _(),{currentPage:q,currentPageSize:z,pageCount:B,isFirstPage:W,isLastPage:X,prev:Y,next:H}}function o7(J){return J.value!==null&&J.value!==void 0}import{ref as a7}from"@stacksjs/stx";function t7(J){let $=a7(!1);try{$.value=J()}catch{$.value=!1}return $}import{ref as e7,watch as JQ}from"@stacksjs/stx";function $Q(J,$={}){let{method:Q="parseFloat",radix:G=10,nanToZero:Z=!1}=$,K=e7(0);function q(z){if(typeof z==="number")return z;let M;if(Q==="parseInt")M=Number.parseInt(z,G);else M=Number.parseFloat(z);if(Z&&Number.isNaN(M))return 0;return M}if(K.value=q(T(J)),typeof J==="function");else if(J&&typeof J==="object"&&"value"in J&&"subscribe"in J)JQ(J,(z)=>{K.value=q(z)});return K}import{ref as QQ,watch as ZQ}from"@stacksjs/stx";function GQ(J){let $=QQ(String(T(J)??""));if(j(J))ZQ(J,(Q)=>{$.value=String(Q??"")});return $}import{ref as KQ,watch as qQ}from"@stacksjs/stx";function zQ(J,$){let Q=KQ(J.value??$);return qQ(J,(G)=>{Q.value=G??$}),Q}import{ref as MQ,watch as BQ}from"@stacksjs/stx";function I9(J,$=1000){let Q=MQ(J),G=null;return BQ(Q,()=>{if(G!==null)clearTimeout(G);G=setTimeout(()=>{Q.value=J,G=null},$)}),Q}var XQ=I9;function WQ(J){return JSON.parse(JSON.stringify(J))}var _Q={justNow:"just now",past:(J)=>`${J} ago`,future:(J)=>`in ${J}`,second:(J)=>`${J} second${J>1?"s":""}`,minute:(J)=>`${J} minute${J>1?"s":""}`,hour:(J)=>`${J} hour${J>1?"s":""}`,day:(J)=>`${J} day${J>1?"s":""}`,week:(J)=>`${J} week${J>1?"s":""}`,month:(J)=>`${J} month${J>1?"s":""}`,year:(J)=>`${J} year${J>1?"s":""}`};function YQ(J,$={}){let Q={..._Q,...$.messages},G=J instanceof Date?J:new Date(J),K=Date.now()-G.getTime(),q=Math.abs(K),z=Math.floor(q/1000),M=Math.floor(z/60),B=Math.floor(M/60),W=Math.floor(B/24),X=Math.floor(W/7),_=Math.floor(W/30),Y=Math.floor(W/365),H=K<0;function F(O){return H?Q.future(O):Q.past(O)}if(z<5)return Q.justNow;if(z<60)return F(Q.second(z));if(M<60)return F(Q.minute(M));if(B<24)return F(Q.hour(B));if(W<7)return F(Q.day(W));if(X<4)return F(Q.week(X));if(_<12)return F(Q.month(_));return F(Q.year(Y))}import{watch as HQ}from"@stacksjs/stx";function FQ(J){function $(M,B={}){let{timeout:W,throwOnTimeout:X=!1}=B;if(M(J.value))return Promise.resolve(J.value);return new Promise((_,Y)=>{let H=null,F=HQ(J,(O)=>{if(M(O)){if(F(),H!==null)clearTimeout(H);_(O)}});if(W!==void 0)H=setTimeout(()=>{if(F(),X)Y(Error("Timeout"));else _(J.value)},W)})}function Q(M,B){return $((W)=>W===M,B)}function G(M){return $((B)=>Boolean(B),M)}function Z(M){return $((B)=>B===null,M)}function K(M){return $((B)=>B===void 0,M)}function q(M){return $((B)=>Number.isNaN(B),M)}function z(M){let B=J.value;return $((W)=>W!==B,M)}return{toMatch:$,toBe:Q,toBeTruthy:G,toBeNull:Z,toBeUndefined:K,toBeNaN:q,changed:z,not:{toBe:(M,B)=>$((W)=>W!==M,B),toBeTruthy:(M)=>$((B)=>!B,M),toBeNull:(M)=>$((B)=>B!==null,M),toBeUndefined:(M)=>$((B)=>B!==void 0,M),toBeNaN:(M)=>$((B)=>!Number.isNaN(B),M)}}}import{ref as LQ}from"@stacksjs/stx";function OQ(J){if(j(J))return J;return LQ(J)}function AQ(J,$){for(let[Q,G]of Object.entries($))if(Q!=="value")J[Q]=G;return J}function NQ(J,$){let Q=new Map,G=$??((...K)=>JSON.stringify(K)),Z=function(...K){let q=G(...K);if(Q.has(q))return Q.get(q);let z=J(...K);return Q.set(q,z),z};return Z.load=(...K)=>{let q=G(...K),z=J(...K);return Q.set(q,z),z},Z.delete=(...K)=>{let q=G(...K);Q.delete(q)},Z.clear=()=>{Q.clear()},Z.cache=Q,Z}function PQ(J,$){let Q={...J};return Object.defineProperty(Q,Symbol.iterator,{enumerable:!1,value(){let G=0;return{next:()=>({value:$[G++],done:G>$.length})}}}),Q}import{watch as uJ}from"@stacksjs/stx";function DQ(J,$,Q={}){let{direction:G="both"}=Q,Z=!1,K=[];if(G==="both"||G==="ltr")K.push(uJ(J,(q)=>{if(Z)return;Z=!0,$.value=q,Z=!1}));if(G==="both"||G==="rtl")K.push(uJ($,(q)=>{if(Z)return;Z=!0,J.value=q,Z=!1}));return()=>{for(let q of K)q()}}function CQ(J,$){let Q=J.map((G)=>uJ(G,(Z)=>{$.value=Z}));return()=>{for(let G of Q)G()}}function EQ(J){let $=!1,Q;return()=>{if(!$)Q=J(),$=!0;return Q}}function TQ(J){let $=0,Q;return(...G)=>{if($++,!Q)Q=J(...G);return Q}}import{onUnmounted as cJ}from"@stacksjs/stx";function VQ(J){J()}function jQ(J){J()}function UQ(J){try{cJ(J)}catch{}}function RQ(J){try{cJ(J)}catch{}}function IQ(J){try{cJ(J)}catch{}}import{ref as v,watch as b9}from"@stacksjs/stx";function w(J,$){if(j(J))b9(J,$)}function k(J){return L(J)}function bQ(J,$,Q){let G=v([]);function Z(){let K=k(J),q=k($);if(Q)G.value=K.filter((z)=>!q.some((M)=>Q(z,M)));else G.value=K.filter((z)=>!q.includes(z))}return Z(),w(J,Z),w($,Z),G}function SQ(J,$){let Q=v(!1);function G(){Q.value=k(J).every($)}return G(),w(J,G),Q}function xQ(J,$){let Q=v([]);function G(){Q.value=k(J).filter($)}return G(),w(J,G),Q}function yQ(J,$){let Q=v(void 0);function G(){Q.value=k(J).find($)}return G(),w(J,G),Q}function wQ(J,$){let Q=v(-1);function G(){Q.value=k(J).findIndex($)}return G(),w(J,G),Q}function kQ(J,$,Q){let G=v(!1);function Z(){let K=k(J),q=L($);if(Q)G.value=K.some((z)=>Q(z,q));else G.value=K.includes(q)}if(Z(),w(J,Z),j($))b9($,Z);return G}function gQ(J,$){let Q=v([]);function G(){Q.value=k(J).map($)}return G(),w(J,G),Q}function hQ(J,$,Q){let G=v(Q);function Z(){G.value=k(J).reduce($,Q)}return Z(),w(J,Z),G}function vQ(J,$){let Q=v(!1);function G(){Q.value=k(J).some($)}return G(),w(J,G),Q}function fQ(J,$){let Q=v([]);function G(){let Z=k(J);if($)Q.value=Z.filter((K,q)=>Z.findIndex((z)=>$(K,z))===q);else Q.value=[...new Set(Z)]}return G(),w(J,G),Q}export{t6 as whenever,D8 as watchWithFilter,N8 as watchTriggerable,Y9 as watchThrottled,H9 as watchPausable,J8 as watchOnce,O8 as watchImmediate,F9 as watchIgnorable,F8 as watchDeep,_9 as watchDebounced,Y8 as watchAtMost,X8 as watchArray,g4 as useWindowSize,p4 as useWindowScroll,f4 as useWindowFocus,i7 as useWebWorkerFn,l7 as useWebWorker,E8 as useWebSocket,f7 as useWebNotification,u7 as useWakeLock,s7 as useVirtualList,p7 as useVibrate,x4 as useUrlSearchParams,D6 as useTrunc,E7 as useTransition,G$ as useToggle,GQ as useToString,$Q as useToNumber,A4 as useTitle,H$ as useTimestamp,s$ as useTimeoutPoll,l$ as useTimeoutFn,d$ as useTimeout,A$ as useTimeAgo,s6 as useThrottledRefHistory,VJ as useThrottledRef,V$ as useThrottleFn,y$ as useThrottle,h7 as useTextareaAutosize,I4 as useTextSelection,U4 as useTextDirection,X2 as useSwipe,t7 as useSupported,P6 as useSum,b7 as useStyleTag,t as useStorage,y6 as useStepper,v6 as useSorted,B7 as useShare,v9 as useSessionStorage,r4 as useScrollLock,u4 as useScroll,U7 as useScriptTag,Z7 as useScreenSafeArea,Q7 as useScreenOrientation,N6 as useRound,g8 as useResizeObserver,c6 as useRefHistory,a$ as useRafFn,I6 as usePrevious,t9 as usePreferredReducedMotion,J7 as usePreferredLanguages,sJ as usePreferredDark,n9 as usePreferredContrast,i9 as usePreferredColorScheme,A6 as usePrecision,_2 as usePointerSwipe,H2 as usePointerLock,M2 as usePointer,z7 as usePermission,K7 as useParentElement,L2 as useParallax,u2 as usePageLeave,$$ as useOnline,n7 as useOffsetPagination,Y7 as useObjectUrl,W$ as useNow,Q$ as useNetwork,a2 as useNavigatorLanguage,f8 as useMutationObserver,q2 as useMousePressed,G2 as useMouseInElement,Q2 as useMouse,l2 as useMounted,O6 as useMin,NQ as useMemoize,K4 as useMediaQuery,L6 as useMax,QJ as useManualRefHistory,X6 as useMagicKeys,h9 as useLocalStorage,x6 as useLastChanged,M6 as useKeyModifier,f$ as useIntervalFn,g$ as useInterval,wJ as useIntersectionObserver,o4 as useInfiniteScroll,H7 as useImage,m2 as useIdle,A2 as useGeolocation,t4 as useFullscreen,J4 as useFps,w2 as useFocusWithin,S2 as useFocus,F6 as useFloor,w7 as useFileDialog,NJ as useFetch,D4 as useFavicon,k7 as useEyeDropper,V8 as useEventSource,D$ as useEventListener,E$ as useEventBus,l8 as useElementVisibility,p8 as useElementSize,s8 as useElementHover,o8 as useElementByPoint,u8 as useElementBounding,n2 as useDropZone,r2 as useDraggable,T4 as useDocumentVisibility,V2 as useDevicePixelRatio,C2 as useDeviceOrientation,P2 as useDeviceMotion,i6 as useDebouncedRefHistory,TJ as useDebouncedRef,T$ as useDebounceFn,b$ as useDebounce,M$ as useDateFormat,p9 as useDark,g6 as useCycleList,e8 as useCssVar,j6 as useCounter,x7 as useConfirmDialog,u9 as useColorMode,d6 as useCloned,Q4 as useClipboardItems,$4 as useClipboard,H6 as useClamp,Y6 as useCeil,w4 as useBrowserLocation,U8 as useBroadcastChannel,M4 as useBreakpoints,U2 as useBattery,O7 as useBase64,_6 as useAverage,n6 as useAsyncState,o6 as useAsyncQueue,fQ as useArrayUnique,vQ as useArraySome,hQ as useArrayReduce,gQ as useArrayMap,kQ as useArrayIncludes,wQ as useArrayFindIndex,yQ as useArrayFind,xQ as useArrayFilter,SQ as useArrayEvery,bQ as useArrayDifference,N7 as useAnimate,h2 as useActiveElement,W6 as useAbs,FQ as until,J2 as unrefElement,L as unref,UQ as tryOnUnmounted,IQ as tryOnScopeDispose,VQ as tryOnMounted,RQ as tryOnBeforeUnmount,jQ as tryOnBeforeMount,T as toValue,Y9 as throttledWatch,VJ as throttledRef,CQ as syncRefs,DQ as syncRef,x9 as setSSRHandler,OQ as resolveRef,VJ as refThrottled,zQ as refDefault,TJ as refDebounced,I9 as refAutoReset,K8 as pausableWatch,E6 as or,K6 as onStartTyping,Z6 as onLongPress,$6 as onKeyUp,RJ as onKeyStroke,J6 as onKeyDown,e4 as onClickOutside,N as noop,PQ as makeDestructurable,M9 as logicOr,C6 as logicNot,j as isRef,o7 as isDefined,M8 as ignorableWatch,S9 as getSSRHandler,YQ as formatTimeAgo,AQ as extendRef,T7 as executeTransition,O9 as eagerComputed,U as defaultWindow,FJ as defaultNavigator,a as defaultDocument,_9 as debouncedWatch,TJ as debouncedRef,y9 as customStorageEventName,TQ as createSharedComposable,EQ as createGlobalState,K$ as createFetch,JJ as createEventHook,O9 as computedEager,L9 as computedAsync,WQ as cloneFnJSON,_4 as breakpointsVuetify,B4 as breakpointsTailwind,F4 as breakpointsSematic,Y4 as breakpointsQuasar,H4 as breakpointsMasterCss,X4 as breakpointsBootstrapV5,Z9 as breakpointsBootstrap,W4 as breakpointsAntDesign,XQ as autoResetRef,L9 as asyncComputed,T6 as and,pJ as TransitionPresets};
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stacksjs/composables",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.70.23",
|
|
5
|
+
"description": "Stacks composables powered by stx reactivity.",
|
|
6
|
+
"author": "Chris Breuer",
|
|
7
|
+
"contributors": [
|
|
8
|
+
"Chris Breuer <chris@stacksjs.com>"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"funding": "https://github.com/sponsors/chrisbbreuer",
|
|
12
|
+
"homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/composables#readme",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
16
|
+
"directory": "./storage/framework/core/composables"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/stacksjs/stacks/issues"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"composables",
|
|
23
|
+
"reactivity",
|
|
24
|
+
"stx",
|
|
25
|
+
"stacks"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"bun": "./src/index.ts",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./*": {
|
|
34
|
+
"bun": "./src/*",
|
|
35
|
+
"import": "./dist/*"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"module": "dist/index.js",
|
|
39
|
+
"types": "dist/index.d.ts",
|
|
40
|
+
"files": [
|
|
41
|
+
"README.md",
|
|
42
|
+
"dist"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "bun build.ts",
|
|
46
|
+
"typecheck": "bun tsc --noEmit",
|
|
47
|
+
"prepublishOnly": "bun run build"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@stacksjs/stx": "^0.2.40",
|
|
51
|
+
"@stacksjs/datetime": "0.70.23"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"better-dx": "^0.2.12"
|
|
55
|
+
}
|
|
56
|
+
}
|