// @bun
var{defineProperty:N,getOwnPropertyNames:W,getOwnPropertyDescriptor:C}=Object,S=Object.prototype.hasOwnProperty;function w(j){return this[j]}var p=(j)=>{var G=(O??=new WeakMap).get(j),I;if(G)return G;if(G=N({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var K of W(j))if(!S.call(G,K))N(G,K,{get:w.bind(j,K),enumerable:!(I=C(j,K))||I.enumerable})}return O.set(j,G),G},O;var B=(j)=>j;function V(j,G){this[j]=B.bind(null,G)}var u=(j,G)=>{for(var I in G)N(j,I,{get:G[I],enumerable:!0,configurable:!0,set:V.bind(G,I)})};var x=(j,G)=>()=>(j&&(G=j(j=0)),G);var r=import.meta.require;function R(j){let G=j,I=new Set,K=new Set,L=()=>{if(U)K.add(U);return G};return L.set=(M)=>{if(!Object.is(M,G)){let T=G;if(G=M,I.forEach((Q)=>Q(G,T)),_)K.forEach((Q)=>H.add(Q));else K.forEach((Q)=>Q())}},L.update=(M)=>{L.set(M(G))},L.subscribe=(M)=>{return I.add(M),()=>I.delete(M)},Object.defineProperty(L,"_isSignal",{value:!0,writable:!1}),L}function y(j){let G,I=!0,K=new Set,L=()=>{if(!I)if(I=!0,_)K.forEach((T)=>H.add(T));else K.forEach((T)=>T())},M=()=>{if(U)K.add(U);if(I){let T=U;U=L,q.push(L);try{G=j()}finally{q.pop(),U=T}I=!1}return G};return Object.defineProperty(M,"_isDerived",{value:!0,writable:!1}),M}function E(j,G={}){let I,K=!1,L=()=>{if(K)return;if(I)I(),I=void 0;let M=U;U=L,q.push(L);try{I=j()}finally{q.pop(),U=M}};if(G.immediate!==!1)L();return()=>{if(K=!0,I)I()}}function f(j){if(_){j();return}_=!0;try{j()}finally{_=!1,H.forEach((G)=>G()),H.clear()}}function l(j){D.push(j)}function n(j){h.push(j)}function b(j){return typeof j==="function"&&j._isSignal===!0}function g(j){return typeof j==="function"&&j._isDerived===!0}function c(j){if(b(j)||g(j))return j();return j}function k(j){let G=U;U=null;try{return j()}finally{U=G}}function s(j,G){let I=typeof j==="function"?j:()=>j,K=R([]),L=y(()=>K().reduce((Q,X)=>G(Q,X.action),I())),M=!1;return E(()=>{if(I(),!M){M=!0;return}if(k(()=>K().length))K.set([])}),[L,(Q,X)=>{let $={action:Q};K.set([...K(),$]);let Y=()=>{let Z=K().filter((J)=>J!==$);if(Z.length!==K().length)K.set(Z)};if(X&&typeof X.then==="function")Promise.resolve(X).then(Y,Y);return Y}]}var U=null,q,_=!1,H,D,h;var P=x(()=>{q=[],H=new Set,D=[],h=[]});P();var m=encodeURIComponent,F=decodeURIComponent;function z(){if(typeof document>"u")return{};let j={},G=document.cookie.split(";");for(let I of G){let[K,...L]=I.trim().split("=");if(K)try{j[K]=F(L.join("="))}catch{j[K]=L.join("=")}}return j}function a(j){return z()[j]??null}function A(j,G,I){let{maxAge:K,expires:L,path:M="/",domain:T,secure:Q,sameSite:X="Lax",encode:$=m}=I,Y=[`${j}=${G?$(G):""}`];if(M)Y.push(`path=${M}`);if(T)Y.push(`domain=${T}`);if(G==="")Y.push("max-age=0");else if(typeof K==="number")Y.push(`max-age=${K}`);else if(L!==void 0){let J=L instanceof Date?L:typeof L==="number"?new Date(Date.now()+L*1000):new Date(L);Y.push(`expires=${J.toUTCString()}`)}Y.push(`SameSite=${X}`);let Z=Q;if(Z===void 0)Z=typeof location<"u"&&location.protocol==="https:";if(Z)Y.push("Secure");return Y.join("; ")}function d(j,G,I={}){if(typeof document>"u")return;document.cookie=A(j,G,I)}function v(j,G={}){d(j,"",{...G,maxAge:0,expires:new Date(0)})}function e(j,G={}){let I=G.decode||F,K=G.defaultValue??"",L=j.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),M=new RegExp(`(?:^|; )${L}=([^;]*)`);function T(){if(typeof document>"u")return K;let X=document.cookie.match(M);return X?I(X[1]):K}let Q=R(T());return Q.subscribe((X)=>{if(typeof document>"u")return;document.cookie=A(j,X,G)}),Q}function jj(){return z()}function Gj(j={}){let G=z();for(let I of Object.keys(G))v(I,j)}export{jj as useCookies,e as useCookie,d as setCookie,v as removeCookie,z as parseCookies,a as getCookie,Gj as clearCookies};
