import{r as p,w as b,bT as g,a1 as F,t as R,bU as d,Z as E}from"./C0u2Lk3h.js";function P(e,t){let u,r,s;const n=p(!0),a=()=>{n.value=!0,s()};b(e,a,{flush:"sync"});const i=typeof t=="function"?t:t.get,o=typeof t=="function"?void 0:t.set,f=g((h,v)=>(r=h,s=v,{get(){return n.value&&(u=i(),n.value=!1),r(),u},set(c){o==null||o(c)}}));return Object.isExtensible(f)&&(f.trigger=a),f}function m(e){return typeof e=="function"?e():E(e)}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const T=()=>{};function W(e,t){function u(...r){return new Promise((s,n)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(s).catch(n)})}return u}const w=e=>e();function A(e=w){const t=p(!0);function u(){t.value=!1}function r(){t.value=!0}const s=(...n)=>{t.value&&e(...n)};return{isActive:d(t),pause:u,resume:r,eventFilter:s}}function x(...e){if(e.length!==1)return R(...e);const t=e[0];return typeof t=="function"?d(g(()=>({get:t,set:T}))):p(t)}function k(e,t,u={}){const{eventFilter:r=w,...s}=u;return b(e,W(r,t),s)}function y(e,t,u={}){const{eventFilter:r,...s}=u,{eventFilter:n,pause:a,resume:i,isActive:o}=A(r);return{stop:k(e,t,{...s,eventFilter:n}),pause:a,resume:i,isActive:o}}function G(e,t,...[u]){const{flush:r="sync",deep:s=!1,immediate:n=!0,direction:a="both",transform:i={}}=u||{},o=[],f="ltr"in i&&i.ltr||(c=>c),h="rtl"in i&&i.rtl||(c=>c);return(a==="both"||a==="ltr")&&o.push(y(e,c=>{o.forEach(l=>l.pause()),t.value=f(c),o.forEach(l=>l.resume())},{flush:r,deep:s,immediate:n})),(a==="both"||a==="rtl")&&o.push(y(t,c=>{o.forEach(l=>l.pause()),e.value=h(c),o.forEach(l=>l.resume())},{flush:r,deep:s,immediate:n})),()=>{o.forEach(c=>c.stop())}}function L(e=!1,t={}){const{truthyValue:u=!0,falsyValue:r=!1}=t,s=F(e),n=p(e);function a(i){if(arguments.length)return n.value=i,n.value;{const o=m(u);return n.value=n.value===o?m(r):o,n.value}}return s?a:[n,a]}export{m as a,P as c,G as s,x as t,L as u};
