import{O as N,r as T,P as Q,I as Z,Q as tt,K as nt,R as P,S as W,U,V as et,W as st,L as ot,X as ct,p as V,v as rt,Y as at}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";let X;const I=t=>X=t,Y=Symbol();function A(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var w;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(w||(w={}));function dt(){const t=N(!0),o=t.run(()=>T({}));let e=[],n=[];const r=Q({install(i){I(r),r._a=i,i.provide(Y,r),i.config.globalProperties.$pinia=r,n.forEach(a=>e.push(a)),n=[]},use(i){return this._a?e.push(i):n.push(i),this},_p:e,_a:null,_e:t,_s:new Map,state:o});return r}const q=()=>{};function K(t,o,e,n=q){t.add(o);const r=()=>{t.delete(o)&&n()};return!e&&et()&&st(r),r}function m(t,...o){t.forEach(e=>{e(...o)})}const it=t=>t(),L=Symbol(),M=Symbol();function F(t,o){t instanceof Map&&o instanceof Map?o.forEach((e,n)=>t.set(n,e)):t instanceof Set&&o instanceof Set&&o.forEach(t.add,t);for(const e in o){if(!o.hasOwnProperty(e))continue;const n=o[e],r=t[e];A(r)&&A(n)&&t.hasOwnProperty(e)&&!P(n)&&!W(n)?t[e]=F(r,n):t[e]=n}return t}const ut=Symbol();function ft(t){return!A(t)||!Object.prototype.hasOwnProperty.call(t,ut)}const{assign:p}=Object;function lt(t){return!!(P(t)&&t.effect)}function pt(t,o,e,n){const{state:r,actions:i,getters:a}=o,j=e.state.value[t];let h;function d(){j||(e.state.value[t]=r?r():{});const y=ct(e.state.value[t]);return p(y,i,Object.keys(a||{}).reduce((b,v)=>(b[v]=Q(V(()=>{I(e);const _=e._s.get(t);return a[v].call(_,_)})),b),{}))}return h=z(t,d,o,e,n,!0),h}function z(t,o,e={},n,r,i){let a;const j=p({actions:{}},e),h={deep:!0};let d,y,b=new Set,v=new Set,_;const S=n.state.value[t];!i&&!S&&(n.state.value[t]={});let k;function C(s){let c;d=y=!1,typeof s=="function"?(s(n.state.value[t]),c={type:w.patchFunction,storeId:t,events:_}):(F(n.state.value[t],s),c={type:w.patchObject,payload:s,storeId:t,events:_});const u=k=Symbol();ot().then(()=>{k===u&&(d=!0)}),y=!0,m(b,c,n.state.value[t])}const B=i?function(){const{state:s}=e,c=s?s():{};this.$patch(u=>{p(u,c)})}:q;function D(){a.stop(),b.clear(),v.clear(),n._s.delete(t)}const J=(s,c="")=>{if(L in s)return s[M]=c,s;const u=function(){I(n);const E=Array.from(arguments),$=new Set,x=new Set;function H(f){$.add(f)}function R(f){x.add(f)}m(v,{args:E,name:u[M],store:l,after:H,onError:R});let g;try{g=s.apply(this&&this.$id===t?this:l,E)}catch(f){throw m(x,f),f}return g instanceof Promise?g.then(f=>(m($,f),f)).catch(f=>(m(x,f),Promise.reject(f))):(m($,g),g)};return u[L]=!0,u[M]=c,u},G={_p:n,$id:t,$onAction:K.bind(null,v),$patch:C,$reset:B,$subscribe(s,c={}){const u=K(b,s,c.detached,()=>E()),E=a.run(()=>rt(()=>n.state.value[t],$=>{(c.flush==="sync"?y:d)&&s({storeId:t,type:w.direct,events:_},$)},p({},h,c)));return u},$dispose:D},l=nt(G);n._s.set(t,l);const O=(n._a&&n._a.runWithContext||it)(()=>n._e.run(()=>(a=N()).run(()=>o({action:J}))));for(const s in O){const c=O[s];if(P(c)&&!lt(c)||W(c))i||(S&&ft(c)&&(P(c)?c.value=S[s]:F(c,S[s])),n.state.value[t][s]=c);else if(typeof c=="function"){const u=J(c,s);O[s]=u,j.actions[s]=c}}return p(l,O),p(U(l),O),Object.defineProperty(l,"$state",{get:()=>n.state.value[t],set:s=>{C(c=>{p(c,s)})}}),n._p.forEach(s=>{p(l,a.run(()=>s({store:l,app:n._a,pinia:n,options:j})))}),S&&i&&e.hydrate&&e.hydrate(l.$state,S),d=!0,y=!0,l}function yt(t,o,e){let n;const r=typeof o=="function";n=r?e:o;function i(a,j){const h=tt();return a=a||(h?Z(Y,null):null),a&&I(a),a=X,a._s.has(t)||(r?z(t,o,n,a):pt(t,n,a)),a._s.get(t)}return i.$id=t,i}function bt(t){const o=U(t),e={};for(const n in o){const r=o[n];r.effect?e[n]=V({get:()=>t[n],set(i){t[n]=i}}):(P(r)||W(r))&&(e[n]=at(t,n))}return e}export{dt as c,yt as d,bt as s}; //# sourceMappingURL=pinia-CyoDn8Yz.chunk.mjs.map