UNPKG

@openmrs/esm-laboratory-app

Version:

An O3 frontend module for managing laboratory requests and queues

2 lines 19.7 kB
/*! For license information please see 3495.js.LICENSE.txt */ "use strict";(globalThis.webpackChunk_openmrs_esm_laboratory_app=globalThis.webpackChunk_openmrs_esm_laboratory_app||[]).push([[3495],{39725:(e,t,n)=>{e.exports=n(94370)},59424:(e,t,n)=>{n.d(t,{BE:()=>re,Es:()=>q,Ht:()=>se,PP:()=>Q,Tk:()=>Y,Tn:()=>g,X3:()=>F,ZH:()=>y,aw:()=>le,b0:()=>h,bZ:()=>_,bu:()=>X,dO:()=>N,lK:()=>$,lg:()=>Z,mF:()=>G,mf:()=>M,q9:()=>oe,qm:()=>fe,qv:()=>p,r9:()=>P,rL:()=>m,sb:()=>ee});var r=n(16072);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var u=e.apply(t,n);function a(e){i(u,r,o,a,c,"next",e)}function c(e){i(u,r,o,a,c,"throw",e)}a(void 0)}))}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){a(e,t,n[t])}))}return e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],u=!0,a=!1;try{for(n=n.call(e);!(u=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){a=!0,o=e}finally{try{u||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||d(e,t)||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 l(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function d(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function b(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=a(0),u.throw=a(1),u.return=a(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}var v=function(){},y=v(),p=Object,h=function(e){return e===y},g=function(e){return"function"==typeof e},m=function(e,t){return c({},e,t)},w=function(e){return g(e.then)},E=new WeakMap,O=0,S=function(e){var t,n,r=void 0===e?"undefined":s(e),o=e&&e.constructor,i=o==Date;if(p(e)!==e||i||o==RegExp)t=i?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=E.get(e))return t;if(t=++O+"~",E.set(e,t),o==Array){for(t="@",n=0;n<e.length;n++)t+=S(e[n])+",";E.set(e,t)}if(o==p){t="#";for(var u=p.keys(e).sort();!h(n=u.pop());)h(e[n])||(t+=n+":"+S(e[n])+",");E.set(e,t)}}return t},_=new WeakMap,T={},R={},A="undefined",k=("undefined"==typeof window?"undefined":s(window))!=A,j=("undefined"==typeof document?"undefined":s(document))!=A,P=function(e,t){var n=_.get(e);return[function(){return!h(t)&&e.get(t)||T},function(r){if(!h(t)){var o=e.get(t);t in R||(R[t]=o),n[5](t,m(o,r),o||T)}},n[6],function(){return!h(t)&&t in R?R[t]:!h(t)&&e.get(t)||T}]},V=!0,I=f(k&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[v,v],2),L=I[0],x=I[1],C={isOnline:function(){return V},isVisible:function(){var e=j&&document.visibilityState;return h(e)||"hidden"!==e}},D={initFocus:function(e){return j&&document.addEventListener("visibilitychange",e),L("focus",e),function(){j&&document.removeEventListener("visibilitychange",e),x("focus",e)}},initReconnect:function(e){var t=function(){V=!0,e()},n=function(){V=!1};return L("online",t),L("offline",n),function(){x("online",t),x("offline",n)}}},N=!r.useId,F=!k||"Deno"in window,M=function(e){return k&&s(window.requestAnimationFrame)!=A?window.requestAnimationFrame(e):setTimeout(e,1)},q=F?r.useEffect:r.useLayoutEffect,U="undefined"!=typeof navigator&&navigator.connection,W=!F&&U&&(["slow-2g","2g"].includes(U.effectiveType)||U.saveData),$=function(e){if(g(e))try{e=e()}catch(t){e=""}var t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?S(e):"",t]},H=0,Z=function(){return++H},B=2,X={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:0,MUTATE_EVENT:B,RECONNECT_EVENT:1};function G(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u((function(){var e,n,r,o,i,a,c,l,s,d,v,p,E,O,S,T,R,A,k,j;function V(e){return u((function(){var r,i,u,l,p,m,E,O,S,T,R,A,k,j,V,I,L,x,C,D;return b(this,(function(b){switch(b.label){case 0:if(r=f($(e),1),!(i=r[0]))return[2];if(u=f(P(n,i),2),l=u[0],p=u[1],m=f(_.get(n),4),E=m[0],O=m[1],S=m[2],T=m[3],R=function(){var t=E[i];return(g(a.revalidate)?a.revalidate(l().data,e):!1!==a.revalidate)&&(delete S[i],delete T[i],t&&t[0])?t[0](B).then((function(){return l().data})):l().data},t.length<3)return[2,R()];if(A=o,j=Z(),O[i]=[j,0],V=!h(s),I=l(),L=I.data,x=I._c,C=h(x)?L:x,V&&(s=g(s)?s(C,L):s,p({data:s,_c:C})),g(A))try{A=A(C)}catch(e){k=e}return A&&w(A)?[4,A.catch((function(e){k=e}))]:[3,2];case 1:if(A=b.sent(),j!==O[i][0]){if(k)throw k;return[2,A]}k&&V&&d(k)&&(c=!0,p({data:C,_c:y})),b.label=2;case 2:if(c&&(k||(g(c)?(D=c(A,C),p({data:D,error:y,_c:y})):p({data:A,error:y,_c:y}))),O[i][1]=Z(),Promise.resolve(R()).then((function(){p({_c:y})})),k){if(v)throw k;return[2]}return[2,A]}}))}))()}return b(this,(function(u){if(e=f(t,4),n=e[0],r=e[1],o=e[2],i=e[3],a=m({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{}),c=a.populateCache,l=a.rollbackOnError,s=a.optimisticData,d=function(e){return"function"==typeof l?l(e):!1!==l},v=a.throwOnError,g(r)){p=r,E=[],O=n.keys(),S=!0,T=!1,R=void 0;try{for(A=O[Symbol.iterator]();!(S=(k=A.next()).done);S=!0)j=k.value,!/^\$(inf|sub)\$/.test(j)&&p(n.get(j)._k)&&E.push(j)}catch(e){T=!0,R=e}finally{try{S||null==A.return||A.return()}finally{if(T)throw R}}return[2,Promise.all(E.map(V))]}return[2,V(r)]}))}))()}var J=function(e,t){for(var n in e)e[n][0]&&e[n][0](t)},K=function(e,t){if(!_.has(e)){var n=m(D,t),r={},o=G.bind(y,e),i=v,u={},a=function(e,t){var n=u[e]||[];return u[e]=n,n.push(t),function(){return n.splice(n.indexOf(t),1)}},c=function(t,n,r){e.set(t,n);var o=u[t];if(o){var i=!0,a=!1,c=void 0;try{for(var f,l=o[Symbol.iterator]();!(i=(f=l.next()).done);i=!0)(0,f.value)(n,r)}catch(e){a=!0,c=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw c}}}},f=function(){if(!_.has(e)&&(_.set(e,[r,{},{},{},o,c,a]),!F)){var t=n.initFocus(setTimeout.bind(y,J.bind(y,r,0))),u=n.initReconnect(setTimeout.bind(y,J.bind(y,r,1)));i=function(){t&&t(),u&&u(),_.delete(e)}}};return f(),[e,o,f,i]}return[e,_.get(e)[4]]},z=f(K(new Map),2),Q=z[0],Y=z[1],ee=m({onLoadingSlow:v,onSuccess:v,onError:v,onErrorRetry:function(e,t,n,r,o){var i=n.errorRetryCount,u=o.retryCount,a=~~((Math.random()+.5)*(1<<(u<8?u:8)))*n.errorRetryInterval;!h(i)&&u>i||setTimeout(r,a,o)},onDiscarded:v,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:W?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:W?5e3:3e3,compare:function(e,t){return S(e)==S(t)},isPaused:function(){return!1},cache:Q,mutate:Y,fallback:{}},C),te=function(e,t){var n=m(e,t);if(t){var r=e.use,o=e.fallback,i=t.use,u=t.fallback;r&&i&&(n.use=r.concat(i)),o&&u&&(n.fallback=m(o,u))}return n},ne=(0,r.createContext)({}),re=function(e){var t=e.value,n=(0,r.useContext)(ne),o=g(t),i=(0,r.useMemo)((function(){return o?t(n):t}),[o,n,t]),u=(0,r.useMemo)((function(){return o?i:te(n,i)}),[o,n,i]),a=i&&i.provider,c=(0,r.useRef)(y);a&&!c.current&&(c.current=K(a(u.cache||Q),i));var f=c.current;return f&&(u.cache=f[0],u.mutate=f[1]),q((function(){if(f)return f[2]&&f[2](),f[3]}),[]),(0,r.createElement)(ne.Provider,m(e,{value:u}))},oe="$inf$",ie=k&&window.__SWR_DEVTOOLS_USE__,ue=ie?window.__SWR_DEVTOOLS_USE__:[],ae=function(e){return g(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}]},ce=ue.concat((function(e){return function(t,n,r){var o=n&&function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i=f($(t),1)[0],u=f(_.get(Q),4)[3];if(i.startsWith(oe))return n.apply(void 0,l(r));var a=u[i];return h(a)?n.apply(void 0,l(r)):(delete u[i],a)};return e(t,o,r)}})),fe=function(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];for(var i=m(ee,(0,r.useContext)(ne)),u=f(ae(n),3),a=u[0],c=u[1],l=u[2],s=te(i,l),d=e,b=(s.use||[]).concat(ce),v=b.length;v--;)d=b[v](d);return d(a,c||s.fetcher||null,s)}},le=function(e,t,n){var r=t[e]||(t[e]=[]);return r.push(n),function(){var e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}},se=function(e,t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i,u,a=f(ae(r),3),l=a[0],s=a[1],d=a[2],b=(d.use||[]).concat(t);return e(l,s,(i=c({},d),u=null!=(u={use:b})?u:{},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(u)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(u,e))})),i))}};ie&&(window.__SWR_DEVTOOLS_REACT__=r)},93495:(e,t,n)=>{n.d(t,{Ay:()=>v,BE:()=>b,Tk:()=>i.Tk});var r=n(16072),o=n(39725),i=n(59424);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],u=!0,a=!1;try{for(n=n.call(e);!(u=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){a=!0,o=e}finally{try{u||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||l(e,t)||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 l(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}var s=r.use||function(e){if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(e.status="pending",e.then((function(t){e.status="fulfilled",e.value=t}),(function(t){e.status="rejected",e.reason=t})),e)},d={dedupe:!0},b=i.qv.defineProperty(i.BE,"defaultValue",{value:i.sb}),v=(0,i.qm)((function(e,t,n){var b=n.cache,v=n.compare,y=n.suspense,p=n.fallbackData,h=n.revalidateOnMount,g=n.revalidateIfStale,m=n.refreshInterval,w=n.refreshWhenHidden,E=n.refreshWhenOffline,O=n.keepPreviousData,S=f(i.bZ.get(b),4),_=S[0],T=S[1],R=S[2],A=S[3],k=f((0,i.lK)(e),2),j=k[0],P=k[1],V=(0,r.useRef)(!1),I=(0,r.useRef)(!1),L=(0,r.useRef)(j),x=(0,r.useRef)(t),C=(0,r.useRef)(n),D=function(){return C.current},N=function(){return D().isVisible()&&D().isOnline()},F=f((0,i.r9)(b,j),4),M=F[0],q=F[1],U=F[2],W=F[3],$=(0,r.useRef)({}).current,H=(0,i.b0)(p)?n.fallback[j]:p,Z=function(e,t){for(var n in $){var r=n;if("data"===r){if(!v(e[r],t[r])){if(!(0,i.b0)(e[r]))return!1;if(!v(ee,t[r]))return!1}}else if(t[r]!==e[r])return!1}return!0},B=(0,r.useMemo)((function(){var e=!!j&&!!t&&((0,i.b0)(h)?!D().isPaused()&&!y&&(!!(0,i.b0)(g)||g):h),n=function(t){var n=(0,i.rL)(t);return delete n._k,e?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}({isValidating:!0,isLoading:!0},n):n},r=M(),o=W(),u=n(r),a=r===o?u:n(o),f=u;return[function(){var e=n(M());return Z(e,f)?(f.data=e.data,f.isLoading=e.isLoading,f.isValidating=e.isValidating,f.error=e.error,f):(f=e,e)},function(){return a}]}),[b,j]),X=(0,o.useSyncExternalStore)((0,r.useCallback)((function(e){return U(j,(function(t,n){Z(n,t)||e()}))}),[b,j]),B[0],B[1]),G=!V.current,J=_[j]&&_[j].length>0,K=X.data,z=(0,i.b0)(K)?H:K,Q=X.error,Y=(0,r.useRef)(z),ee=O?(0,i.b0)(K)?Y.current:K:z,te=!(J&&!(0,i.b0)(Q))&&(G&&!(0,i.b0)(h)?h:!D().isPaused()&&(y?!(0,i.b0)(z)&&g:(0,i.b0)(z)||g)),ne=!!(j&&t&&G&&te),re=(0,i.b0)(X.isValidating)?ne:X.isValidating,oe=(0,i.b0)(X.isLoading)?ne:X.isLoading,ie=(0,r.useCallback)((function(e){return(t=function(){var t,r,o,u,a,c,l,s,d,b,y,p,h,g,m,w,E;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=a(0),u.throw=a(1),u.return=a(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(O){switch(O.label){case 0:if(t=x.current,!j||!t||I.current||D().isPaused())return[2,!1];u=!0,a=e||{},c=!R[j]||!a.dedupe,l=function(){return i.dO?!I.current&&j===L.current&&V.current:j===L.current},s={isValidating:!1,isLoading:!1},d=function(){q(s)},b=function(){var e=R[j];e&&e[1]===o&&delete R[j]},y={isValidating:!0},(0,i.b0)(M().data)&&(y.isLoading=!0),O.label=1;case 1:return O.trys.push([1,3,,4]),c&&(q(y),n.loadingTimeout&&(0,i.b0)(M().data)&&setTimeout((function(){u&&l()&&D().onLoadingSlow(j,n)}),n.loadingTimeout),R[j]=[t(P),(0,i.lg)()]),p=f(R[j],2),r=p[0],o=p[1],[4,r];case 2:return r=O.sent(),c&&setTimeout(b,n.dedupingInterval),R[j]&&R[j][1]===o?(s.error=i.ZH,h=T[j],!(0,i.b0)(h)&&(o<=h[0]||o<=h[1]||0===h[1])?(d(),c&&l()&&D().onDiscarded(j),[2,!1]):(g=M().data,s.data=v(g,r)?g:r,c&&l()&&D().onSuccess(r,j,n),[3,4])):(c&&l()&&D().onDiscarded(j),[2,!1]);case 3:return m=O.sent(),b(),w=D(),E=w.shouldRetryOnError,w.isPaused()||(s.error=m,c&&l()&&(w.onError(m,j,w),(!0===E||(0,i.Tn)(E)&&E(m))&&(D().revalidateOnFocus&&D().revalidateOnReconnect&&!N()||w.onErrorRetry(m,j,w,(function(e){var t=_[j];t&&t[0]&&t[0](i.bu.ERROR_REVALIDATE_EVENT,e)}),{retryCount:(a.retryCount||0)+1,dedupe:!0})))),[3,4];case 4:return u=!1,d(),[2,!0]}}))},function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function u(e){a(i,r,o,u,c,"next",e)}function c(e){a(i,r,o,u,c,"throw",e)}u(void 0)}))})();var t}),[j,b]),ue=(0,r.useCallback)((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.mF.apply(void 0,[b,L.current].concat(function(e){if(Array.isArray(e))return u(e)}(r=t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||l(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()));var r}),[]);if((0,i.Es)((function(){x.current=t,C.current=n,(0,i.b0)(K)||(Y.current=K)})),(0,i.Es)((function(){if(j){var e=ie.bind(i.ZH,d),t=0,n=(0,i.aw)(j,_,(function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n==i.bu.FOCUS_EVENT){var o=Date.now();D().revalidateOnFocus&&o>t&&N()&&(t=o+D().focusThrottleInterval,e())}else if(n==i.bu.RECONNECT_EVENT)D().revalidateOnReconnect&&N()&&e();else{if(n==i.bu.MUTATE_EVENT)return ie();if(n==i.bu.ERROR_REVALIDATE_EVENT)return ie(r)}}));return I.current=!1,L.current=j,V.current=!0,q({_k:P}),te&&((0,i.b0)(z)||i.X3?e():(0,i.mf)(e)),function(){I.current=!0,n()}}}),[j]),(0,i.Es)((function(){var e,t=function(){var t=(0,i.Tn)(m)?m(M().data):m;t&&-1!==e&&(e=setTimeout(n,t))},n=function(){M().error||!w&&!D().isVisible()||!E&&!D().isOnline()?t():ie(d).then(t)};return t(),function(){e&&(clearTimeout(e),e=-1)}}),[m,w,E,j]),(0,r.useDebugValue)(ee),y&&(0,i.b0)(z)&&j){if(!i.dO&&i.X3)throw new Error("Fallback data is required when using suspense in SSR.");x.current=t,C.current=n,I.current=!1;var ae=A[j];if(!(0,i.b0)(ae)){var ce=ue(ae);s(ce)}if(!(0,i.b0)(Q))throw Q;var fe=ie(d);(0,i.b0)(ee)||(fe.status="fulfilled",fe.value=!0),s(fe)}return{mutate:ue,get data(){return $.data=!0,ee},get error(){return $.error=!0,Q},get isValidating(){return $.isValidating=!0,re},get isLoading(){return $.isLoading=!0,oe}}}))},94370:(e,t,n)=>{var r=n(16072),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,u=r.useEffect,a=r.useLayoutEffect,c=r.useDebugValue;function f(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,l=r[1];return a((function(){o.value=n,o.getSnapshot=t,f(o)&&l({inst:o})}),[e,n,t]),u((function(){return f(o)&&l({inst:o}),e((function(){f(o)&&l({inst:o})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l}}]);