@getontime/cli
Version:
Time keeping for live events
2 lines • 2.84 kB
JavaScript
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./useIsSmallScreen-legacy-DavgXfPB.js"],function(e,t){var n,o,a,r;function l(e){try{return e&&JSON.parse(e)}catch{return e}}function i(e){return{getItem:t=>{try{return window[e].getItem(t)}catch(n){return console.warn("use-local-storage: Failed to get value from storage, localStorage is blocked"),null}},setItem:(t,n)=>{try{window[e].setItem(t,n)}catch(o){console.warn("use-local-storage: Failed to set value to storage, localStorage is blocked")}},removeItem:t=>{try{window[e].removeItem(t)}catch(n){console.warn("use-local-storage: Failed to remove value from storage, localStorage is blocked")}}}}function s(e,t){const n="localStorage"===e?"mantine-local-storage":"mantine-session-storage",{getItem:o,setItem:s,removeItem:u}=i(e);return function({key:i,defaultValue:c,getInitialValueInEffect:d=!0,sync:f=!0,deserialize:w=l,serialize:g=e=>function(e,t="use-local-storage"){try{return JSON.stringify(e)}catch(n){throw new Error(`@mantine/hooks ${t}: Failed to serialize the value`)}}(e,t)}){const y=(0,r.useCallback)(t=>{let n;try{n="undefined"==typeof window||!(e in window)||null===window[e]||!!t}catch(r){n=!0}if(n)return c;const a=o(i);return null!==a?w(a):c},[i,c]),[v,m]=(0,r.useState)(y(d)),b=(0,r.useCallback)(e=>{e instanceof Function?m(t=>{const o=e(t);return s(i,g(o)),queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(n,{detail:{key:i,value:e(t)}}))}),o}):(s(i,g(e)),window.dispatchEvent(new CustomEvent(n,{detail:{key:i,value:e}})),m(e))},[i]),I=(0,r.useCallback)(()=>{u(i),m(c),window.dispatchEvent(new CustomEvent(n,{detail:{key:i,value:c}}))},[i,c]);return a("storage",t=>{f&&t.storageArea===window[e]&&t.key===i&&m(w(t.newValue??void 0))}),a(n,e=>{f&&e.detail.key===i&&m(e.detail.value)}),(0,r.useEffect)(()=>{void 0!==c&&void 0===v&&b(c)},[c,v,b]),(0,r.useEffect)(()=>{const e=y();void 0!==e&&b(e)},[i]),[void 0===v?c:v,b,I]}}function u(e){const{getItem:t}=i(e);return function({key:n,defaultValue:o,deserialize:a=l}){let r;try{r="undefined"==typeof window||!(e in window)||null===window[e]}catch(s){r=!0}if(r)return o;const i=t(n);return null!==i?a(i):o}}return e({n:s,r:u,t:function(e){return s("localStorage","use-local-storage")(e)}}),{setters:[function(e){n=e.a,o=e.n},function(e){a=e._}],execute:function(){!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"f14ad0099eab1969fdd065b56af5fdd3cf530de6"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9fc2343a-9203-4f6e-a330-341a5853b463",e._sentryDebugIdIdentifier="sentry-dbid-9fc2343a-9203-4f6e-a330-341a5853b463")}catch(e){}}(),r=n(o(),1),u("localStorage")}}});
//# sourceMappingURL=use-local-storage-legacy-Xbm6tq51.js.map