"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[47588],{1161:function(n,e,t){t.d(e,{Mj:function(){return s},Q3:function(){return d}}),t(29305),t(32733),t(84701),t(81678),t(24776),t(14382),t(69892),t(84734),t(44962),t(89336),t(4754),t(58551),t(94),t(33087),t(36947),t(36457),t(88908),t(26437),t(83810),t(52697),t(78557),t(96054),t(90076),t(95021),t(73687),t(83994),t(23630),t(82367);var r=t(63696),o=t(28601);function u(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var t=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=t){var r,o,u,i,c=[],a=!0,l=!1;try{if(u=(t=t.call(n)).next,0===e){if(Object(t)!==t)return;a=!1}else for(;!(a=(r=u.call(t)).done)&&(c.push(r.value),c.length!==e);a=!0);}catch(n){l=!0,o=n}finally{try{if(!a&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(n,e)||function(n,e){if(n){if("string"==typeof n)return i(n,e);var t={}.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(n,e):void 0}}(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}var c="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function a(n,e,t,o){var u=(0,r.useRef)(e);c((function(){u.current=e}),[e]),(0,r.useEffect)((function(){var e,r=null!==(e=null==t?void 0:t.current)&&void 0!==e?e:window;if(r&&r.addEventListener){var i=function(n){u.current(n)};return r.addEventListener(n,i,o),function(){r.removeEventListener(n,i,o)}}}),[n,t,o])}function l(n){var e=(0,r.useRef)((function(){throw new Error("Cannot call an event handler while rendering.")}));return c((function(){e.current=n}),[n]),(0,r.useCallback)((function(){for(var n,t,r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];return null==(t=e.current)?void 0:(n=t).call.apply(n,[e].concat(o))}),[e])}var f="undefined"==typeof window;function s(n,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.initializeWithValue,i=void 0===o||o,c=(0,r.useCallback)((function(n){return t.serializer?t.serializer(n):JSON.stringify(n)}),[t]),s=(0,r.useCallback)((function(n){if(t.deserializer)return t.deserializer(n);if("undefined"!==n){var r,o=e instanceof Function?e():e;try{r=JSON.parse(n)}catch(n){return console.error("Error parsing JSON:",n),o}return r}}),[t,e]),v=(0,r.useCallback)((function(){var t=e instanceof Function?e():e;if(f)return t;try{var r=window.localStorage.getItem(n);return r?s(r):t}catch(e){return console.warn("Error reading localStorage key “".concat(n,"”:"),e),t}}),[e,n,s]),d=u((0,r.useState)((function(){return i?v():e instanceof Function?e():e})),2),y=d[0],g=d[1],h=l((function(e){f&&console.warn("Tried setting localStorage key “".concat(n,"” even though environment is not a client"));try{var t=e instanceof Function?e(v()):e;window.localStorage.setItem(n,c(t)),g(t),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))}catch(e){console.warn("Error setting localStorage key “".concat(n,"”:"),e)}})),w=l((function(){f&&console.warn("Tried removing localStorage key “".concat(n,"” even though environment is not a client"));var t=e instanceof Function?e():e;window.localStorage.removeItem(n),g(t),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))}));(0,r.useEffect)((function(){g(v())}),[n]);var p=(0,r.useCallback)((function(e){e.key&&e.key!==n||g(v())}),[n,v]);return a("storage",p),a("local-storage",p),[y,h,w]}function v(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,t=arguments.length>2?arguments[2]:void 0,u=(0,r.useRef)();!function(n){var e=(0,r.useRef)(n);e.current=n,(0,r.useEffect)((function(){return function(){e.current()}}),[])}((function(){u.current&&u.current.cancel()}));var i=(0,r.useMemo)((function(){var r=o(n,e,t),i=function(){return r.apply(void 0,arguments)};return i.cancel=function(){r.cancel()},i.isPending=function(){return!!u.current},i.flush=function(){return r.flush()},i}),[n,e,t]);return(0,r.useEffect)((function(){u.current=o(n,e,t)}),[n,e,t]),i}function d(n,e,t){var o,i=null!==(o=null==t?void 0:t.equalityFn)&&void 0!==o?o:function(n,e){return n===e},c=n instanceof Function?n():n,a=u((0,r.useState)(c),2),l=a[0],f=a[1],s=(0,r.useRef)(c),d=v(f,e,t);return i(s.current,c)||(d(c),s.current=c),[l,d]}}}]);