text: import{get as o,set as t,remove as e}from"@analytics/global-storage-utils";export{globalContext}from"@analytics/global-storage-utils";import{hasCookies as r,getCookie as l,setCookie as a,removeCookie as i}from"@analytics/cookie-utils";export{getCookie,hasCookies,removeCookie,setCookie}from"@analytics/cookie-utils";import{hasLocalStorage as n}from"@analytics/localstorage-utils";export{hasLocalStorage}from"@analytics/localstorage-utils";import{isObject as c,isUndefined as u,isString as s}from"@analytics/type-utils";function g(o){let t=o;try{if(t=JSON.parse(o),"true"===t)return!0;if("false"===t)return!1;if(c(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(o){}if(null!==t&&""!==t)return t}const f="*",m="any",p="localStorage",S="cookie",k="global",y=n(),b=r();function v(t,e){if(!t)return;const r=C(e),a=!F(r),i=d(r)?g(localStorage.getItem(t)):void 0;if(a&&!u(i))return i;const n=h(r)?g(l(t)):void 0;if(a&&n)return n;const c=o(t);return a?c:{localStorage:i,cookie:n,global:c}}function I(e,r,i){if(!e||u(r))return;const n={},c=C(i),s=JSON.stringify(r),f=!F(c);return d(c)&&(n.localStorage={location:"localStorage",current:r,previous:g(localStorage.getItem(e))},localStorage.setItem(e,s),f)?n.localStorage:h(c)&&(n.cookie={location:"cookie",current:r,previous:g(l(e))},a(e,s),f)?n.cookie:(n.global={location:"global",current:r,previous:o(e)},t(e,r),f?n.global:n)}function x(o,t){if(!o)return;const r=C(t),l=v(o,"*"),a={};return!u(l.localStorage)&&d(r)&&(localStorage.removeItem(o),a.localStorage=l.localStorage),!u(l.cookie)&&h(r)&&(i(o),a.cookie=l.cookie),!u(l.global)&&J(r,"global")&&(e(o),a.global=l.global),a}function C(o){return o?s(o)?o:o.storage:"any"}function d(o){return y&&J(o,"localStorage")}function h(o){return b&&J(o,"cookie")}function F(o){return"*"===o||"all"===o}function J(o,t){return"any"===o||o===t||F(o)}var N={setItem:I,getItem:v,removeItem:x};export default N;export{f as ALL,m as ANY,S as COOKIE,k as GLOBAL,p as LOCAL_STORAGE,v as getItem,x as removeItem,I as setItem};
  //# sourceMappingURL=analytics-util-storage.modern.js.map
  